mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 09:52:13 +02:00
Enable the use of multiple dots in FS Shell commands (#1547)
Every dot after `..` means another parent directory.
This commit is contained in:
committed by
GitHub
parent
c4daa2e40f
commit
d0618b0b32
@@ -131,3 +131,26 @@ fn fails_when_glob_doesnt_match() {
|
||||
assert!(actual.contains("invalid file or pattern"));
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_files_from_two_parents_up_using_multiple_dots() {
|
||||
Playground::setup("ls_test_6", |dirs, sandbox| {
|
||||
sandbox.with_files(vec![
|
||||
EmptyFile("yahuda.yaml"),
|
||||
EmptyFile("jonathan.json"),
|
||||
EmptyFile("andres.xml"),
|
||||
EmptyFile("kevin.txt"),
|
||||
]);
|
||||
|
||||
sandbox.within("foo").mkdir("bar");
|
||||
|
||||
let actual = nu!(
|
||||
cwd: dirs.test().join("foo/bar"),
|
||||
r#"
|
||||
ls ... | count | echo $it
|
||||
"#
|
||||
);
|
||||
|
||||
assert_eq!(actual, "5");
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user