mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 00:13:21 +01:00
using use
instead of overlay use
in some tests
This commit is contained in:
parent
ccd871d712
commit
2ae24b24c3
@ -385,7 +385,7 @@ fn use_def_import_after_hide() -> TestResult {
|
||||
#[test]
|
||||
fn use_env_import_after_hide() -> TestResult {
|
||||
run_test(
|
||||
r#"module spam { export-env { let-env foo = "foo" } }; overlay use spam; hide-env foo; overlay use spam; $env.foo"#,
|
||||
r#"module spam { export-env { let-env foo = "foo" } }; use spam; hide-env foo; use spam; $env.foo"#,
|
||||
"foo",
|
||||
)
|
||||
}
|
||||
@ -417,7 +417,7 @@ fn hides_all_decls_within_scope() -> TestResult {
|
||||
#[test]
|
||||
fn hides_all_envs_within_scope() -> TestResult {
|
||||
fail_test(
|
||||
r#"module spam { export-env { let-env foo = "bar" } }; let-env foo = "foo"; overlay use spam; hide-env foo; $env.foo"#,
|
||||
r#"module spam { export-env { let-env foo = "bar" } }; let-env foo = "foo"; use spam; hide-env foo; $env.foo"#,
|
||||
"did you mean",
|
||||
)
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ fn module_def_imports_5() -> TestResult {
|
||||
#[test]
|
||||
fn module_env_imports_1() -> TestResult {
|
||||
run_test(
|
||||
r#"module foo { export-env { let-env a = '1' } }; overlay use foo; $env.a"#,
|
||||
r#"module foo { export-env { let-env a = '1' } }; use foo; $env.a"#,
|
||||
"1",
|
||||
)
|
||||
}
|
||||
@ -51,7 +51,7 @@ fn module_env_imports_1() -> TestResult {
|
||||
#[test]
|
||||
fn module_env_imports_2() -> TestResult {
|
||||
run_test(
|
||||
r#"module foo { export-env { let-env a = '1'; let-env b = '2' } }; overlay use foo; $env.b"#,
|
||||
r#"module foo { export-env { let-env a = '1'; let-env b = '2' } }; use foo; $env.b"#,
|
||||
"2",
|
||||
)
|
||||
}
|
||||
@ -59,7 +59,7 @@ fn module_env_imports_2() -> TestResult {
|
||||
#[test]
|
||||
fn module_env_imports_3() -> TestResult {
|
||||
run_test(
|
||||
r#"module foo { export-env { let-env a = '1' }; export-env { let-env b = '2' }; export-env {let-env c = '3'} }; overlay use foo; $env.c"#,
|
||||
r#"module foo { export-env { let-env a = '1' }; export-env { let-env b = '2' }; export-env {let-env c = '3'} }; use foo; $env.c"#,
|
||||
"3",
|
||||
)
|
||||
}
|
||||
@ -67,7 +67,7 @@ fn module_env_imports_3() -> TestResult {
|
||||
#[test]
|
||||
fn module_def_and_env_imports_1() -> TestResult {
|
||||
run_test(
|
||||
r#"module spam { export-env { let-env foo = "foo" }; export def foo [] { "bar" } }; overlay use spam; $env.foo"#,
|
||||
r#"module spam { export-env { let-env foo = "foo" }; export def foo [] { "bar" } }; use spam; $env.foo"#,
|
||||
"foo",
|
||||
)
|
||||
}
|
||||
@ -91,7 +91,7 @@ fn module_def_import_uses_internal_command() -> TestResult {
|
||||
#[test]
|
||||
fn module_env_import_uses_internal_command() -> TestResult {
|
||||
run_test(
|
||||
r#"module foo { def b [] { "2" }; export-env { let-env a = b } }; use foo; overlay use foo; $env.a"#,
|
||||
r#"module foo { def b [] { "2" }; export-env { let-env a = b } }; use foo; use foo; $env.a"#,
|
||||
"2",
|
||||
)
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ fn update_overlay_from_module_env() {
|
||||
#[test]
|
||||
fn overlay_use_do_not_eval_twice() {
|
||||
let inp = &[
|
||||
r#"module spam { export env FOO { "foo" } }"#,
|
||||
r#"module spam { export-env { let-env FOO = "foo" } }"#,
|
||||
r#"overlay use spam"#,
|
||||
r#"let-env FOO = "bar""#,
|
||||
r#"overlay hide spam"#,
|
||||
|
Loading…
Reference in New Issue
Block a user