allow for $in to affect environment (#6649)

* allow for `$in` to affect environment

* fix for vars, overlays, env_hidden

* fmt

* carry over variables properly

* add test

* modify name, remove redundant

* fmt
This commit is contained in:
pwygab
2022-10-13 17:04:34 +08:00
committed by GitHub
parent d40a73aafe
commit 90ba39184a
3 changed files with 51 additions and 6 deletions

View File

@ -3,6 +3,20 @@ use nu_test_support::nu;
use nu_test_support::playground::Playground;
use std::path::PathBuf;
#[test]
fn cd_works_with_in_var() {
Playground::setup("cd_test_1", |dirs, _| {
let actual = nu!(
cwd: dirs.root(),
r#"
"cd_test_1" | cd $in; $env.PWD | path split | last
"#
);
assert_eq!("cd_test_1", actual.out);
})
}
// FIXME: jt: needs more work
#[ignore]
#[test]