using use instead of overlay use in some tests

This commit is contained in:
WindSoilder 2022-09-19 17:01:13 +08:00
parent ccd871d712
commit 2ae24b24c3
3 changed files with 8 additions and 8 deletions

View File

@ -385,7 +385,7 @@ fn use_def_import_after_hide() -> TestResult {
#[test] #[test]
fn use_env_import_after_hide() -> TestResult { fn use_env_import_after_hide() -> TestResult {
run_test( 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", "foo",
) )
} }
@ -417,7 +417,7 @@ fn hides_all_decls_within_scope() -> TestResult {
#[test] #[test]
fn hides_all_envs_within_scope() -> TestResult { fn hides_all_envs_within_scope() -> TestResult {
fail_test( 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", "did you mean",
) )
} }

View File

@ -43,7 +43,7 @@ fn module_def_imports_5() -> TestResult {
#[test] #[test]
fn module_env_imports_1() -> TestResult { fn module_env_imports_1() -> TestResult {
run_test( 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", "1",
) )
} }
@ -51,7 +51,7 @@ fn module_env_imports_1() -> TestResult {
#[test] #[test]
fn module_env_imports_2() -> TestResult { fn module_env_imports_2() -> TestResult {
run_test( 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", "2",
) )
} }
@ -59,7 +59,7 @@ fn module_env_imports_2() -> TestResult {
#[test] #[test]
fn module_env_imports_3() -> TestResult { fn module_env_imports_3() -> TestResult {
run_test( 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", "3",
) )
} }
@ -67,7 +67,7 @@ fn module_env_imports_3() -> TestResult {
#[test] #[test]
fn module_def_and_env_imports_1() -> TestResult { fn module_def_and_env_imports_1() -> TestResult {
run_test( 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", "foo",
) )
} }
@ -91,7 +91,7 @@ fn module_def_import_uses_internal_command() -> TestResult {
#[test] #[test]
fn module_env_import_uses_internal_command() -> TestResult { fn module_env_import_uses_internal_command() -> TestResult {
run_test( 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", "2",
) )
} }

View File

@ -256,7 +256,7 @@ fn update_overlay_from_module_env() {
#[test] #[test]
fn overlay_use_do_not_eval_twice() { fn overlay_use_do_not_eval_twice() {
let inp = &[ let inp = &[
r#"module spam { export env FOO { "foo" } }"#, r#"module spam { export-env { let-env FOO = "foo" } }"#,
r#"overlay use spam"#, r#"overlay use spam"#,
r#"let-env FOO = "bar""#, r#"let-env FOO = "bar""#,
r#"overlay hide spam"#, r#"overlay hide spam"#,