summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorsharkdp <davidpeter@web.de>2019-08-31 14:13:19 +0200
committersharkdp <davidpeter@web.de>2019-08-31 14:13:36 +0200
commit2e7114680173acd906e53ef5c3dd6e7b77014113 (patch)
treecf7bce82e9e39908e7f6ca0acb8c787216682067 /tests
parentf3824bad17f21276c1d3e758a72a496cee506063 (diff)
Fix another instance of the 'bat cache' bug, closes #584
Diffstat (limited to 'tests')
-rw-r--r--tests/examples/cache.c1
-rw-r--r--tests/integration_tests.rs12
2 files changed, 12 insertions, 1 deletions
diff --git a/tests/examples/cache.c b/tests/examples/cache.c
new file mode 100644
index 00000000..9daeafb9
--- /dev/null
+++ b/tests/examples/cache.c
@@ -0,0 +1 @@
+test
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs
index 6a1e0839..120449a7 100644
--- a/tests/integration_tests.rs
+++ b/tests/integration_tests.rs
@@ -451,7 +451,7 @@ fn utf16() {
#[test]
fn can_print_file_named_cache() {
- bat()
+ bat_with_config()
.arg("cache")
.assert()
.success()
@@ -460,6 +460,16 @@ fn can_print_file_named_cache() {
}
#[test]
+fn can_print_file_starting_with_cache() {
+ bat_with_config()
+ .arg("cache.c")
+ .assert()
+ .success()
+ .stdout("test\n")
+ .stderr("");
+}
+
+#[test]
fn does_not_print_unwanted_file_named_cache() {
bat_with_config().arg("cach").assert().failure();
}