2021-12-25 20:39:42 +01:00
|
|
|
use crate::tests::{run_test, TestResult};
|
|
|
|
|
|
|
|
#[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 {
|
2022-01-04 22:34:42 +01:00
|
|
|
run_test(r#"FOO=BAZ FOO=MOO $env.FOO"#, "MOO")
|
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
|
|
|
}
|
2022-03-11 23:18:39 +01:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn convert_non_string_env_var_to_nothing() -> TestResult {
|
|
|
|
run_test(
|
|
|
|
r#"let-env FOO = true; env | where name == FOO | get raw.0 | describe"#,
|
|
|
|
"nothing",
|
|
|
|
)
|
|
|
|
}
|