2024-05-13 13:37:53 +00:00
|
|
|
use crate::repl::tests::{fail_test, run_test, TestResult};
|
2024-04-20 15:04:41 +00:00
|
|
|
use nu_test_support::nu;
|
2021-12-25 19:39:42 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn shorthand_env_1() -> TestResult {
|
2022-01-04 21:34:42 +00:00
|
|
|
run_test(r#"FOO=BAZ $env.FOO"#, "BAZ")
|
2021-12-25 19:39:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn shorthand_env_2() -> TestResult {
|
2024-04-16 11:08:58 +00:00
|
|
|
fail_test(r#"FOO=BAZ FOO=MOO $env.FOO"#, "defined_twice")
|
2021-12-25 19:39:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn shorthand_env_3() -> TestResult {
|
2022-01-04 21:34:42 +00:00
|
|
|
run_test(r#"FOO=BAZ BAR=MOO $env.FOO"#, "BAZ")
|
2021-12-25 19:39:42 +00:00
|
|
|
}
|
2024-04-20 15:04:41 +00: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>");
|
|
|
|
}
|