remove several export env usage in test code

This commit is contained in:
WindSoilder
2022-09-03 16:15:38 +08:00
parent 0b080338a9
commit 3f7b5657c9
9 changed files with 18 additions and 139 deletions

View File

@ -54,14 +54,6 @@ impl Command for Module {
span: Span::test_data(),
}),
},
Example {
description: "Define an environment variable in a module and evaluate it",
example: r#"module foo { export env FOO_ENV { "BAZ" } }; use foo FOO_ENV; $env.FOO_ENV"#,
result: Some(Value::String {
val: "BAZ".to_string(),
span: Span::test_data(),
}),
},
Example {
description: "Define a custom command that participates in the environment in a module and call it",
example: r#"module foo { export def-env bar [] { let-env FOO_BAR = "BAZ" } }; use foo bar; bar; $env.FOO_BAR"#,

View File

@ -125,7 +125,7 @@ impl Command for OverlayHide {
},
Example {
description: "Hide the last activated overlay",
example: r#"module spam { export env FOO { "foo" } }
example: r#"module spam { export-env { let-env FOO = "foo" } }
overlay use spam
overlay hide"#,
result: None,

View File

@ -199,7 +199,7 @@ impl Command for OverlayUse {
},
Example {
description: "Create an overlay from a file",
example: r#"echo 'export env FOO { "foo" }' | save spam.nu
example: r#"echo 'export-env { let-env FOO = "foo" }' | save spam.nu
overlay use spam.nu
$env.FOO"#,
result: None,

View File

@ -145,14 +145,6 @@ impl Command for Use {
span: Span::test_data(),
}),
},
Example {
description: "Define an environment variable in a module and evaluate it",
example: r#"module foo { export env FOO_ENV { "BAZ" } }; use foo FOO_ENV; $env.FOO_ENV"#,
result: Some(Value::String {
val: "BAZ".to_string(),
span: Span::test_data(),
}),
},
Example {
description: "Define a custom command that participates in the environment in a module and call it",
example: r#"module foo { export def-env bar [] { let-env FOO_BAR = "BAZ" } }; use foo bar; bar; $env.FOO_BAR"#,

View File

@ -189,9 +189,9 @@ impl Command for ViewSource {
},
Example {
description: "View the source of a module",
example: r#"module mod-foo { export env FOO_ENV { 'BAZ' } }; view-source mod-foo"#,
example: r#"module mod-foo { export-env { let-env FOO_ENV = 'BAZ' } }; view-source mod-foo"#,
result: Some(Value::String {
val: " export env FOO_ENV { 'BAZ' }".to_string(),
val: " export-env { let-env FOO_ENV = 'BAZ' }".to_string(),
span: Span::test_data(),
}),
},

View File

@ -230,7 +230,7 @@ fn parse_module_success_2() {
r#"
# foo.nu
export env MYNAME { "Arthur, King of the Britons" }
export-env { let-env MYNAME = "Arthur, King of the Britons" }
"#,
)]);