Sibling dir test

This commit is contained in:
Sam Hedin 2020-07-11 10:43:51 +02:00
parent 72e4b856af
commit 016a328d32

View File

@ -41,6 +41,7 @@ fn takes_rows_of_nu_value_strings_and_pipes_it_to_stdin_of_external() {
fn autoenv() { fn autoenv() {
Playground::setup("autoenv_test_1", |dirs, sandbox| { Playground::setup("autoenv_test_1", |dirs, sandbox| {
sandbox.mkdir("foo/bar"); sandbox.mkdir("foo/bar");
sandbox.mkdir("foob");
sandbox.with_files(vec![ sandbox.with_files(vec![
FileWithContent( FileWithContent(
".nu-env", ".nu-env",
@ -67,6 +68,16 @@ fn autoenv() {
), ),
]); ]);
//Going to sibling directory without passing parent should work.
let actual = nu!(
cwd: dirs.test(),
r#"autoenv trust foo
cd foob
cd ../foo
echo $nu.env.fookey"#
);
assert!(actual.out.ends_with("fooval"));
//Make sure basic keys are set //Make sure basic keys are set
let actual = nu!( let actual = nu!(
cwd: dirs.test(), cwd: dirs.test(),