From 332e12ded0d94c8205b75a766903f376bd3eaa54 Mon Sep 17 00:00:00 2001 From: Matt Clarke Date: Mon, 21 Sep 2020 09:56:37 +0200 Subject: [PATCH] Added test for `ls -a` (#2582) --- crates/nu-cli/tests/commands/ls.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/crates/nu-cli/tests/commands/ls.rs b/crates/nu-cli/tests/commands/ls.rs index fddf34554d..b1e96c6f30 100644 --- a/crates/nu-cli/tests/commands/ls.rs +++ b/crates/nu-cli/tests/commands/ls.rs @@ -252,6 +252,30 @@ fn lists_all_hidden_files_when_glob_does_not_contain_dot() { }) } +#[test] +fn lists_files_including_starting_with_dot() { + Playground::setup("ls_test_9", |dirs, sandbox| { + sandbox.with_files(vec![ + EmptyFile("yehuda.txt"), + EmptyFile("jonathan.txt"), + EmptyFile("andres.txt"), + EmptyFile(".hidden1.txt"), + EmptyFile(".hidden2.txt"), + ]); + + let actual = nu!( + cwd: dirs.test(), pipeline( + r#" + ls -a + | count + | echo $it + "# + )); + + assert_eq!(actual.out, "5"); + }) +} + #[test] fn list_all_columns() { Playground::setup(