2024-05-13 15:37:53 +02:00
|
|
|
use crate::repl::tests::{fail_test, run_test, TestResult};
|
2024-04-20 17:04:41 +02:00
|
|
|
use nu_test_support::nu;
|
2021-12-25 20:39:42 +01:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn shorthand_env_1() -> TestResult {
|
2022-01-04 22:34:42 +01:00
|
|
|
run_test(r#"FOO=BAZ $env.FOO"#, "BAZ")
|
2021-12-25 20:39:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn shorthand_env_2() -> TestResult {
|
2024-04-16 13:08:58 +02:00
|
|
|
fail_test(r#"FOO=BAZ FOO=MOO $env.FOO"#, "defined_twice")
|
2021-12-25 20:39:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn shorthand_env_3() -> TestResult {
|
2022-01-04 22:34:42 +01:00
|
|
|
run_test(r#"FOO=BAZ BAR=MOO $env.FOO"#, "BAZ")
|
2021-12-25 20:39:42 +01:00
|
|
|
}
|
2024-04-20 17:04:41 +02:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn default_nu_lib_dirs_type() {
|
|
|
|
let actual = nu!("$env.NU_LIB_DIRS | describe");
|
|
|
|
assert_eq!(actual.out, "list<string>");
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn default_nu_plugin_dirs_type() {
|
|
|
|
let actual = nu!("$env.NU_PLUGIN_DIRS | describe");
|
|
|
|
assert_eq!(actual.out, "list<string>");
|
|
|
|
}
|