mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-26 20:16:33 +00:00
Make --map-syntax and --ignored-suffix work together (#2260)
* Make --map-syntax and --ignored-suffix work together * Minor refactor
This commit is contained in:
1 parent
c14ce4f7ca
commit
9a924b445b
5 files changed
+41
-1
No files matched your search
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"test": "value"}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"test": "value"}
|
||||
@@ -1536,6 +1536,36 @@ fn all_global_git_config_locations_syntax_mapping_work() {
|
||||
.stderr("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn map_syntax_and_ignored_suffix_work_together() {
|
||||
bat()
|
||||
.arg("-f")
|
||||
.arg("--theme")
|
||||
.arg("Monokai Extended")
|
||||
.arg("-p")
|
||||
.arg("--ignored-suffix=.suffix")
|
||||
.arg("--map-syntax=*.demo:JSON")
|
||||
.arg("test.demo.suffix")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout("\u{1b}[38;5;231m{\u{1b}[0m\u{1b}[38;5;208m\"\u{1b}[0m\u{1b}[38;5;208mtest\u{1b}[0m\u{1b}[38;5;208m\"\u{1b}[0m\u{1b}[38;5;231m:\u{1b}[0m\u{1b}[38;5;231m \u{1b}[0m\u{1b}[38;5;186m\"\u{1b}[0m\u{1b}[38;5;186mvalue\u{1b}[0m\u{1b}[38;5;186m\"\u{1b}[0m\u{1b}[38;5;231m}\u{1b}[0m")
|
||||
.stderr("");
|
||||
|
||||
bat()
|
||||
.arg("-f")
|
||||
.arg("--theme")
|
||||
.arg("Monokai Extended")
|
||||
.arg("-p")
|
||||
.arg("--ignored-suffix=.suffix")
|
||||
.arg("--ignored-suffix=.foo")
|
||||
.arg("--map-syntax=*.demo:JSON")
|
||||
.arg("test.demo.foo.suffix")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout("\u{1b}[38;5;231m{\u{1b}[0m\u{1b}[38;5;208m\"\u{1b}[0m\u{1b}[38;5;208mtest\u{1b}[0m\u{1b}[38;5;208m\"\u{1b}[0m\u{1b}[38;5;231m:\u{1b}[0m\u{1b}[38;5;231m \u{1b}[0m\u{1b}[38;5;186m\"\u{1b}[0m\u{1b}[38;5;186mvalue\u{1b}[0m\u{1b}[38;5;186m\"\u{1b}[0m\u{1b}[38;5;231m}\u{1b}[0m")
|
||||
.stderr("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn acknowledgements() {
|
||||
bat()
|
||||
|
||||
Reference in new issue
Block a user