adjust hiding relative test case

This commit is contained in:
WindSoilder 2022-09-03 16:28:10 +08:00
parent 3f7b5657c9
commit 4369af6d05

View File

@ -336,7 +336,7 @@ fn hides_alias_import_then_reimports() -> TestResult {
#[test]
fn hides_env_import_1() -> TestResult {
fail_test(
r#"module spam { export env foo { "foo" } }; use spam; hide-env 'spam foo'; $env.'spam foo'"#,
r#"module spam { export-env { let-env foo = "foo" } }; overlay use spam; hide-env foo; $env.foo"#,
"did you mean",
)
}
@ -345,41 +345,7 @@ fn hides_env_import_1() -> TestResult {
#[ignore]
fn hides_env_import_2() -> TestResult {
fail_test(
r#"module spam { export env foo { "foo" } }; use spam; hide-env spam; $env.'spam foo'"#,
"did you mean",
)
}
#[test]
#[ignore]
fn hides_env_import_3() -> TestResult {
fail_test(
r#"module spam { export env foo { "foo" } }; use spam; hide-env spam [foo]; $env.'spam foo'"#,
"did you mean",
)
}
#[test]
fn hides_env_import_4() -> TestResult {
fail_test(
r#"module spam { export env foo { "foo" } }; use spam foo; hide-env foo; $env.foo"#,
"did you mean",
)
}
#[test]
fn hides_env_import_5() -> TestResult {
fail_test(
r#"module spam { export env foo { "foo" } }; use spam *; hide-env foo; $env.foo"#,
"did you mean",
)
}
#[test]
#[ignore]
fn hides_env_import_6() -> TestResult {
fail_test(
r#"module spam { export env foo { "foo" } }; use spam *; hide-env spam *; $env.foo"#,
r#"module spam { export-env { let-env foo = "foo" } }; overlay use spam; hide-env spam; $env.foo"#,
"did you mean",
)
}
@ -387,7 +353,7 @@ fn hides_env_import_6() -> TestResult {
#[test]
fn hides_def_runs_env_import() -> TestResult {
run_test(
r#"module spam { export env foo { "foo" }; export def foo [] { "bar" } }; use spam foo; hide foo; $env.foo"#,
r#"module spam { export-env { let-env foo = "foo" }; export def foo [] { "bar" } }; overlay use spam; hide foo; $env.foo"#,
"foo",
)
}
@ -395,7 +361,7 @@ fn hides_def_runs_env_import() -> TestResult {
#[test]
fn hides_def_and_env_import_1() -> TestResult {
fail_test(
r#"module spam { export env foo { "foo" }; export def foo [] { "bar" } }; use spam foo; hide foo; hide-env foo; $env.foo"#,
r#"module spam { export-env { let-env foo = "foo" }; export def foo [] { "bar" } }; overlay use spam; hide foo; hide-env foo; $env.foo"#,
"did you mean",
)
}
@ -403,7 +369,7 @@ fn hides_def_and_env_import_1() -> TestResult {
#[test]
fn hides_def_and_env_import_2() -> TestResult {
fail_test(
r#"module spam { export env foo { "foo" }; export def foo [] { "bar" } }; use spam foo; hide foo; hide-env foo; foo"#,
r#"module spam { export-env { let-env foo = "foo" }; export def foo [] { "bar" } }; overlay use spam; hide foo; hide-env foo; foo"#,
"", // we just care if it errors
)
}
@ -435,7 +401,7 @@ fn hide_shadowed_decl() -> TestResult {
#[test]
fn hide_shadowed_env() -> TestResult {
run_test(
r#"module spam { export env foo { "bar" } }; let-env foo = "foo"; do { use spam foo; hide-env foo; $env.foo }"#,
r#"module spam { export-env { let foo = "bar" } }; let-env foo = "foo"; overlay use spam; hide-env foo; $env.foo"#,
"foo",
)
}