It ls test setup rewrite. (#1260)

This commit is contained in:
Andrés N. Robalino 2020-01-21 22:56:12 -05:00 committed by GitHub
parent 3c01526869
commit 762c798670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,14 +73,18 @@ fn lists_regular_files_using_question_mark_wildcard() {
#[test] #[test]
fn lists_all_files_in_directories_from_stream() { fn lists_all_files_in_directories_from_stream() {
Playground::setup("ls_test_4", |dirs, sandbox| { Playground::setup("ls_test_4", |dirs, sandbox| {
sandbox.mkdir("dir_a").mkdir("dir_b").with_files(vec![ sandbox
EmptyFile("root1.txt"), .with_files(vec![EmptyFile("root1.txt"), EmptyFile("root2.txt")])
EmptyFile("root2.txt"), .within("dir_a")
EmptyFile("dir_a/yehuda.10.txt"), .with_files(vec![
EmptyFile("dir_a/jonathan.10.txt"), EmptyFile("yehuda.10.txt"),
EmptyFile("dir_b/andres.10.txt"), EmptyFile("jonathan.10.txt"),
EmptyFile("dir_b/chicken_not_to_be_picked_up.100.txt"), ])
]); .within("dir_b")
.with_files(vec![
EmptyFile("andres.10.txt"),
EmptyFile("chicken_not_to_be_picked_up.100.txt"),
]);
let actual = nu!( let actual = nu!(
cwd: dirs.test(), pipeline( cwd: dirs.test(), pipeline(