mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 03:15:00 +02:00
Remove old nushell/merge engine-q
This commit is contained in:
@ -9,11 +9,7 @@ use serial_test::serial;
|
||||
#[test]
|
||||
fn env_shorthand() {
|
||||
let actual = nu!(cwd: ".", r#"
|
||||
<<<<<<< HEAD
|
||||
FOO=bar echo $nu.env.FOO
|
||||
=======
|
||||
FOO=bar echo $env.FOO
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#);
|
||||
assert_eq!(actual.out, "bar");
|
||||
}
|
||||
@ -21,11 +17,7 @@ fn env_shorthand() {
|
||||
#[test]
|
||||
fn env_shorthand_with_equals() {
|
||||
let actual = nu!(cwd: ".", r#"
|
||||
<<<<<<< HEAD
|
||||
RUST_LOG=my_module=info $nu.env.RUST_LOG
|
||||
=======
|
||||
RUST_LOG=my_module=info $env.RUST_LOG
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#);
|
||||
assert_eq!(actual.out, "my_module=info");
|
||||
}
|
||||
@ -33,11 +25,7 @@ fn env_shorthand_with_equals() {
|
||||
#[test]
|
||||
fn env_shorthand_with_comma_equals() {
|
||||
let actual = nu!(cwd: ".", r#"
|
||||
<<<<<<< HEAD
|
||||
RUST_LOG=info,my_module=info $nu.env.RUST_LOG
|
||||
=======
|
||||
RUST_LOG=info,my_module=info $env.RUST_LOG
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#);
|
||||
assert_eq!(actual.out, "info,my_module=info");
|
||||
}
|
||||
@ -45,11 +33,7 @@ fn env_shorthand_with_comma_equals() {
|
||||
#[test]
|
||||
fn env_shorthand_with_comma_colons_equals() {
|
||||
let actual = nu!(cwd: ".", r#"
|
||||
<<<<<<< HEAD
|
||||
RUST_LOG=info,my_module=info,lib_crate::lib_mod=trace $nu.env.RUST_LOG
|
||||
=======
|
||||
RUST_LOG=info,my_module=info,lib_crate::lib_mod=trace $env.RUST_LOG
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#);
|
||||
assert_eq!(actual.out, "info,my_module=info,lib_crate::lib_mod=trace");
|
||||
}
|
||||
@ -57,11 +41,7 @@ fn env_shorthand_with_comma_colons_equals() {
|
||||
#[test]
|
||||
fn env_shorthand_multi_second_with_comma_colons_equals() {
|
||||
let actual = nu!(cwd: ".", r#"
|
||||
<<<<<<< HEAD
|
||||
FOO=bar RUST_LOG=info,my_module=info,lib_crate::lib_mod=trace $nu.env.FOO + $nu.env.RUST_LOG
|
||||
=======
|
||||
FOO=bar RUST_LOG=info,my_module=info,lib_crate::lib_mod=trace $env.FOO + $env.RUST_LOG
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#);
|
||||
assert_eq!(
|
||||
actual.out,
|
||||
@ -72,11 +52,7 @@ fn env_shorthand_multi_second_with_comma_colons_equals() {
|
||||
#[test]
|
||||
fn env_shorthand_multi_first_with_comma_colons_equals() {
|
||||
let actual = nu!(cwd: ".", r#"
|
||||
<<<<<<< HEAD
|
||||
RUST_LOG=info,my_module=info,lib_crate::lib_mod=trace FOO=bar $nu.env.FOO + $nu.env.RUST_LOG
|
||||
=======
|
||||
RUST_LOG=info,my_module=info,lib_crate::lib_mod=trace FOO=bar $env.FOO + $env.RUST_LOG
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#);
|
||||
assert_eq!(
|
||||
actual.out,
|
||||
@ -87,11 +63,7 @@ fn env_shorthand_multi_first_with_comma_colons_equals() {
|
||||
#[test]
|
||||
fn env_shorthand_multi() {
|
||||
let actual = nu!(cwd: ".", r#"
|
||||
<<<<<<< HEAD
|
||||
FOO=bar BAR=baz $nu.env.FOO + $nu.env.BAR
|
||||
=======
|
||||
FOO=bar BAR=baz $env.FOO + $env.BAR
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#);
|
||||
assert_eq!(actual.out, "barbaz");
|
||||
}
|
||||
|
@ -1,10 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
mod configuration;
|
||||
mod env;
|
||||
mod in_sync;
|
||||
=======
|
||||
mod env;
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
mod nu_env;
|
||||
|
||||
pub mod support {
|
||||
|
@ -29,11 +29,7 @@ fn picks_up_env_keys_when_entering_trusted_directory() {
|
||||
|
||||
let expected = "testvalue";
|
||||
|
||||
<<<<<<< HEAD
|
||||
let actual = Trusted::in_path(&dirs, || nu!(cwd: dirs.test(), "echo $nu.env.testkey"));
|
||||
=======
|
||||
let actual = Trusted::in_path(&dirs, || nu!(cwd: dirs.test(), "echo $env.testkey"));
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
|
||||
assert_eq!(actual.out, expected);
|
||||
})
|
||||
@ -67,11 +63,7 @@ fn picks_up_and_lets_go_env_keys_when_entering_trusted_directory_with_implied_cd
|
||||
r#"
|
||||
do {autoenv trust -q foo ; = $nothing }
|
||||
foo
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.testkey"#
|
||||
=======
|
||||
echo $env.testkey"#
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
);
|
||||
assert_eq!(actual.out, "testvalue");
|
||||
//Assert testkey is gone when leaving foo
|
||||
@ -81,11 +73,7 @@ fn picks_up_and_lets_go_env_keys_when_entering_trusted_directory_with_implied_cd
|
||||
do {autoenv trust -q foo; = $nothing } ;
|
||||
foo
|
||||
..
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.testkey
|
||||
=======
|
||||
echo $env.testkey
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#
|
||||
);
|
||||
assert!(actual.err.contains("Unknown"));
|
||||
@ -96,13 +84,8 @@ fn picks_up_and_lets_go_env_keys_when_entering_trusted_directory_with_implied_cd
|
||||
do {autoenv trust -q foo; = $nothing } ;
|
||||
do {autoenv trust -q foo/bar; = $nothing } ;
|
||||
foo/bar
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.testkey
|
||||
echo $nu.env.bar
|
||||
=======
|
||||
echo $env.testkey
|
||||
echo $env.bar
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#
|
||||
);
|
||||
assert_eq!(actual.out, "testvaluetrue");
|
||||
@ -112,11 +95,7 @@ fn picks_up_and_lets_go_env_keys_when_entering_trusted_directory_with_implied_cd
|
||||
r#"autoenv trust -q foo;
|
||||
foo/bar
|
||||
../..
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.bar"#
|
||||
=======
|
||||
echo $env.bar"#
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
);
|
||||
assert!(actual.err.contains("Unknown"));
|
||||
});
|
||||
@ -143,11 +122,7 @@ fn picks_up_script_vars_when_entering_trusted_directory() {
|
||||
|
||||
let expected = "myval";
|
||||
|
||||
<<<<<<< HEAD
|
||||
let actual = Trusted::in_path(&dirs, || nu!(cwd: dirs.test(), "echo $nu.env.myscript"));
|
||||
=======
|
||||
let actual = Trusted::in_path(&dirs, || nu!(cwd: dirs.test(), "echo $env.myscript"));
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
|
||||
// scriptvars are not supported
|
||||
// and why is myval expected when myscript is "echo myval"
|
||||
@ -171,11 +146,7 @@ fn picks_up_env_keys_when_entering_trusted_directory_indirectly() {
|
||||
let actual = Trusted::in_path(&dirs, || {
|
||||
nu!(cwd: dirs.test().join("crates"), r#"
|
||||
cd ../../autoenv_test_3
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.nu-ver
|
||||
=======
|
||||
echo $env.nu-ver
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#)
|
||||
});
|
||||
|
||||
@ -355,11 +326,7 @@ fn given_a_hierachy_of_trusted_directories_when_entering_in_any_nested_ones_shou
|
||||
nu!(cwd: dirs.test().parent().unwrap(), r#"
|
||||
do { autoenv trust -q autoenv_test_9/nu_plugin_rb ; = $nothing } # Silence autoenv trust -q message from output
|
||||
cd autoenv_test_9/nu_plugin_rb
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.organization
|
||||
=======
|
||||
echo $env.organization
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#)
|
||||
});
|
||||
|
||||
@ -390,11 +357,7 @@ fn given_a_hierachy_of_trusted_directories_nested_ones_should_overwrite_variable
|
||||
nu!(cwd: dirs.test().parent().unwrap(), r#"
|
||||
do { autoenv trust -q autoenv_test_10/nu_plugin_rb ; = $nothing } # Silence autoenv trust -q message from output
|
||||
cd autoenv_test_10/nu_plugin_rb
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.organization
|
||||
=======
|
||||
echo $env.organization
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#)
|
||||
});
|
||||
|
||||
@ -422,11 +385,7 @@ fn local_config_should_not_be_added_when_running_scripts() {
|
||||
FileWithContent(
|
||||
"script.nu",
|
||||
r#"cd foo
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.organization"#,
|
||||
=======
|
||||
echo $env.organization"#,
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
),
|
||||
]);
|
||||
|
||||
@ -465,11 +424,7 @@ fn given_a_hierachy_of_trusted_directories_going_back_restores_overwritten_varia
|
||||
cd nu_plugin_rb
|
||||
do { rm ../.nu-env | ignore } # By deleting the root nu-env we have guarantees that the variable gets restored (not by autoenv when re-entering)
|
||||
cd ..
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.organization
|
||||
=======
|
||||
echo $env.organization
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#)
|
||||
});
|
||||
|
||||
@ -495,22 +450,14 @@ fn local_config_env_var_present_and_removed_correctly() {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(),
|
||||
r#"autoenv trust -q foo;
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.testkey"#
|
||||
=======
|
||||
echo $env.testkey"#
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
);
|
||||
assert!(actual.err.contains("Unknown"));
|
||||
//Assert testkey is present in foo
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(),
|
||||
r#"autoenv trust -q foo; cd foo
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.testkey"#
|
||||
=======
|
||||
echo $env.testkey"#
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
);
|
||||
assert_eq!(actual.out, "testvalue");
|
||||
//Assert testkey is present also in subdirectories
|
||||
@ -518,22 +465,14 @@ fn local_config_env_var_present_and_removed_correctly() {
|
||||
cwd: dirs.test(),
|
||||
r#"autoenv trust -q foo; cd foo
|
||||
cd bar
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.testkey"#
|
||||
=======
|
||||
echo $env.testkey"#
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
);
|
||||
assert_eq!(actual.out, "testvalue");
|
||||
//Assert testkey is present also when jumping over foo
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(),
|
||||
r#"autoenv trust -q foo; cd foo/bar
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.testkey"#
|
||||
=======
|
||||
echo $env.testkey"#
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
);
|
||||
assert_eq!(actual.out, "testvalue");
|
||||
//Assert testkey removed after leaving foo
|
||||
@ -541,11 +480,7 @@ fn local_config_env_var_present_and_removed_correctly() {
|
||||
cwd: dirs.test(),
|
||||
r#"autoenv trust -q foo; cd foo
|
||||
cd ..
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.testkey"#
|
||||
=======
|
||||
echo $env.testkey"#
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
);
|
||||
assert!(actual.err.contains("Unknown"));
|
||||
});
|
||||
@ -577,22 +512,14 @@ fn local_config_env_var_gets_overwritten() {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(),
|
||||
r#"autoenv trust -q foo;
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.overwrite_me"#
|
||||
=======
|
||||
echo $env.overwrite_me"#
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
);
|
||||
assert!(actual.err.contains("Unknown"));
|
||||
//Assert overwrite_me is foo in foo
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(),
|
||||
r#"autoenv trust -q foo; cd foo
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.overwrite_me"#
|
||||
=======
|
||||
echo $env.overwrite_me"#
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
);
|
||||
assert_eq!(actual.out, "foo");
|
||||
//Assert overwrite_me is bar in bar
|
||||
@ -602,22 +529,14 @@ fn local_config_env_var_gets_overwritten() {
|
||||
autoenv trust -q foo/bar
|
||||
cd foo
|
||||
cd bar
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.overwrite_me"#
|
||||
=======
|
||||
echo $env.overwrite_me"#
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
);
|
||||
assert_eq!(actual.out, "bar");
|
||||
//Assert overwrite_me is present also when jumping over foo
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(),
|
||||
r#"autoenv trust -q foo; autoenv trust -q foo/bar; cd foo/bar
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.overwrite_me
|
||||
=======
|
||||
echo $env.overwrite_me
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
"#
|
||||
);
|
||||
assert_eq!(actual.out, "bar");
|
||||
@ -627,11 +546,7 @@ fn local_config_env_var_gets_overwritten() {
|
||||
r#"autoenv trust -q foo; autoenv trust -q foo/bar; cd foo
|
||||
cd bar
|
||||
cd ..
|
||||
<<<<<<< HEAD
|
||||
echo $nu.env.overwrite_me"#
|
||||
=======
|
||||
echo $env.overwrite_me"#
|
||||
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
|
||||
);
|
||||
assert_eq!(actual.out, "foo");
|
||||
});
|
||||
|
Reference in New Issue
Block a user