mirror of
https://github.com/nushell/nushell.git
synced 2025-08-24 10:55:53 +02:00
Run ENV_CONVERSIONS whenever it's modified (#14591)
- this PR should close #14514 # Description Makes updates to `$env.ENV_CONVERSIONS` take effect immediately. # User-Facing Changes No breaking change, `$env.ENV_CONVERSIONS` can be set and its effect used in the same file. # Tests + Formatting - 🟢 toolkit fmt - 🟢 toolkit clippy - 🟢 toolkit test - 🟢 toolkit test stdlib # After Submitting N/A
This commit is contained in:
@@ -190,6 +190,16 @@ fn env_var_case_insensitive() {
|
||||
assert!(actual.out.contains("222"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn env_conversion_on_assignment() {
|
||||
let actual = nu!(r#"
|
||||
$env.FOO = "bar:baz:quox"
|
||||
$env.ENV_CONVERSIONS = { FOO: { from_string: {|| split row ":"} } }
|
||||
$env.FOO | to nuon
|
||||
"#);
|
||||
assert_eq!(actual.out, "[bar, baz, quox]");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn std_log_env_vars_are_not_overridden() {
|
||||
let actual = nu_with_std!(
|
||||
|
Reference in New Issue
Block a user