Fix accidental printing of files named 'cache'

This also adds two regression tests, so this will hopefully not pop up
again.

closes #557
This commit is contained in:
sharkdp authored and David Peter committed 2019-05-10 17:55:46 -05:00
1 parent 2b9d25df05
commit 72152296c7
4 files changed
+18 -1

No files matched your search

+15
View File
@@ -448,3 +448,18 @@ fn utf16() {
.success()
.stdout(std::str::from_utf8(b"\xEF\xBB\xBFhello world\n").unwrap());
}
#[test]
fn can_print_file_named_cache() {
bat()
.arg("cache")
.assert()
.success()
.stdout("test\n")
.stderr("");
}
#[test]
fn does_not_print_unwanted_file_named_cache() {
bat_with_config().arg("cach").assert().failure();
}