mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-30 10:06:12 +00:00
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:
1 parent
2b9d25df05
commit
72152296c7
4 files changed
+18
-1
No files matched your search
Generated
+2
@@ -1,3 +1,5 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "adler32"
|
name = "adler32"
|
||||||
version = "1.0.3"
|
version = "1.0.3"
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|||||||
.global_setting(AppSettings::DeriveDisplayOrder)
|
.global_setting(AppSettings::DeriveDisplayOrder)
|
||||||
.global_setting(AppSettings::UnifiedHelpMessage)
|
.global_setting(AppSettings::UnifiedHelpMessage)
|
||||||
.global_setting(AppSettings::HidePossibleValuesInHelp)
|
.global_setting(AppSettings::HidePossibleValuesInHelp)
|
||||||
.setting(AppSettings::InferSubcommands)
|
|
||||||
.setting(AppSettings::ArgsNegateSubcommands)
|
.setting(AppSettings::ArgsNegateSubcommands)
|
||||||
.setting(AppSettings::DisableHelpSubcommand)
|
.setting(AppSettings::DisableHelpSubcommand)
|
||||||
.setting(AppSettings::VersionlessSubcommands)
|
.setting(AppSettings::VersionlessSubcommands)
|
||||||
|
|||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
test
|
||||||
@@ -448,3 +448,18 @@ fn utf16() {
|
|||||||
.success()
|
.success()
|
||||||
.stdout(std::str::from_utf8(b"\xEF\xBB\xBFhello world\n").unwrap());
|
.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();
|
||||||
|
}
|
||||||
Reference in new issue
Block a user