Fix command name lookup for known externals (#7830)

Fixes https://github.com/nushell/nushell/issues/7822
This commit is contained in:
Jakub Žádník
2023-01-22 21:40:18 +02:00
committed by GitHub
parent 3552d03f6c
commit ba12b0de0d
3 changed files with 58 additions and 1 deletions

View File

@ -76,3 +76,34 @@ fn known_external_misc_values() -> TestResult {
"abc a b c",
)
}
/// GitHub issue #7822
#[test]
fn known_external_subcommand_from_module() -> TestResult {
run_test_contains(
r#"
module cargo {
export extern check []
};
use cargo;
cargo check -h
"#,
"cargo check",
)
}
/// GitHub issue #7822
#[test]
fn known_external_aliased_subcommand_from_module() -> TestResult {
run_test_contains(
r#"
module cargo {
export extern check []
};
use cargo;
alias cc = cargo check;
cc -h
"#,
"cargo check",
)
}