forked from extern/nushell
Add set-env for setting environment variables (#2802)
This commit is contained in:
@ -345,7 +345,7 @@ fn run_custom_command() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn set_variables() {
|
||||
fn set_variable() {
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
@ -358,6 +358,19 @@ fn set_variables() {
|
||||
assert_eq!(actual.out, "17");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn set_env_variable() {
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
set-env TESTENVVAR = "hello world"
|
||||
echo $nu.env.TESTENVVAR
|
||||
"#
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "hello world");
|
||||
}
|
||||
|
||||
#[cfg(feature = "which")]
|
||||
#[test]
|
||||
fn argument_invocation_reports_errors() {
|
||||
|
Reference in New Issue
Block a user