From 2ae24b24c38faa78c45c1ad76e8bf464bfe2e84f Mon Sep 17 00:00:00 2001 From: WindSoilder Date: Mon, 19 Sep 2022 17:01:13 +0800 Subject: [PATCH] using `use` instead of `overlay use` in some tests --- src/tests/test_hiding.rs | 4 ++-- src/tests/test_modules.rs | 10 +++++----- tests/overlays/mod.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tests/test_hiding.rs b/src/tests/test_hiding.rs index 75f262cf58..048a1164f4 100644 --- a/src/tests/test_hiding.rs +++ b/src/tests/test_hiding.rs @@ -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", ) } diff --git a/src/tests/test_modules.rs b/src/tests/test_modules.rs index 2d9d09c1a7..e8b5c2c7f4 100644 --- a/src/tests/test_modules.rs +++ b/src/tests/test_modules.rs @@ -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", ) } diff --git a/tests/overlays/mod.rs b/tests/overlays/mod.rs index 76383d529f..b522edd86b 100644 --- a/tests/overlays/mod.rs +++ b/tests/overlays/mod.rs @@ -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"#,