Add import pattern support to 'hide'

This commit is contained in:
Jakub Žádník
2021-10-04 20:08:24 +03:00
parent 2b5cc63118
commit 4dacfaa44a
2 changed files with 124 additions and 4 deletions

View File

@ -441,6 +441,46 @@ fn hide_twice_not_allowed() -> TestResult {
)
}
#[test]
fn hides_import_1() -> TestResult {
fail_test(
r#"module spam { export def foo [] { "foo" } }; use spam; hide spam.foo; foo"#,
"not found"
)
}
#[test]
fn hides_import_2() -> TestResult {
fail_test(
r#"module spam { export def foo [] { "foo" } }; use spam; hide spam.*; foo"#,
"not found"
)
}
#[test]
fn hides_import_3() -> TestResult {
fail_test(
r#"module spam { export def foo [] { "foo" } }; use spam; hide spam.[foo]; foo"#,
"not found"
)
}
#[test]
fn hides_import_4() -> TestResult {
fail_test(
r#"module spam { export def foo [] { "foo" } }; use spam.foo; hide foo; foo"#,
"not found"
)
}
#[test]
fn hides_import_5() -> TestResult {
fail_test(
r#"module spam { export def foo [] { "foo" } }; use spam.*; hide foo; foo"#,
"not found"
)
}
#[test]
fn def_twice_should_fail() -> TestResult {
fail_test(