mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 08:52:27 +02:00
Expand Nushell's help system (#7611)
This commit is contained in:
@@ -185,15 +185,29 @@ fn use_export_env_combined() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn use_module_creates_accurate_did_you_mean() {
|
||||
fn use_module_creates_accurate_did_you_mean_1() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
module spam { export def foo [] { "foo" } }; use spam; foo
|
||||
"#
|
||||
module spam { export def foo [] { "foo" } }; use spam; foo
|
||||
"#
|
||||
)
|
||||
);
|
||||
assert!(actual.err.contains(
|
||||
"command 'foo' was not found but it exists in module 'spam'; try using `spam foo`"
|
||||
"command 'foo' was not found but it was imported from module 'spam'; try using `spam foo`"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn use_module_creates_accurate_did_you_mean_2() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
module spam { export def foo [] { "foo" } }; foo
|
||||
"#
|
||||
)
|
||||
);
|
||||
assert!(actual.err.contains(
|
||||
"command 'foo' was not found but it exists in module 'spam'; try importing it with `use`"
|
||||
));
|
||||
}
|
||||
|
Reference in New Issue
Block a user