diff --git a/tests/shell/pipeline/commands/internal.rs b/tests/shell/pipeline/commands/internal.rs index 6e2895616..6e738e03a 100644 --- a/tests/shell/pipeline/commands/internal.rs +++ b/tests/shell/pipeline/commands/internal.rs @@ -41,6 +41,7 @@ fn takes_rows_of_nu_value_strings_and_pipes_it_to_stdin_of_external() { fn autoenv() { Playground::setup("autoenv_test_1", |dirs, sandbox| { sandbox.mkdir("foo/bar"); + sandbox.mkdir("foob"); sandbox.with_files(vec![ FileWithContent( ".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 let actual = nu!( cwd: dirs.test(),