mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 14:25:55 +02:00
Add import pattern support to 'hide'
This commit is contained in:
40
src/tests.rs
40
src/tests.rs
@ -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(
|
||||
|
Reference in New Issue
Block a user