Allow exporting extern-wrapped (#10025)

This commit is contained in:
Jakub Žádník
2023-08-18 20:45:33 +03:00
committed by GitHub
parent fe2c498a81
commit cdf09abcc0
6 changed files with 115 additions and 17 deletions

View File

@ -39,6 +39,34 @@ fn known_external_complex_unknown_args() -> TestResult {
)
}
#[test]
fn known_external_from_module() -> TestResult {
run_test_contains(
r#"module spam {
export extern echo []
}
use spam echo
echo foo -b -as -9 --abc -- -Dxmy=AKOO - bar
"#,
"foo -b -as -9 --abc -- -Dxmy=AKOO - bar",
)
}
#[test]
fn known_external_wrapped_from_module() -> TestResult {
run_test_contains(
r#"module spam {
export extern-wrapped my-echo [...rest] { ^echo $rest }
}
use spam
spam my-echo foo -b -as -9 --abc -- -Dxmy=AKOO - bar
"#,
"foo -b -as -9 --abc -- -Dxmy=AKOO - bar",
)
}
#[test]
fn known_external_short_flag_batch_arg_allowed() -> TestResult {
run_test_contains("extern echo [-a, -b: int]; echo -ab 10", "-b 10")