mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-01 10:52:24 +01:00
Case insensitive --map-syntax
(#2650)
Co-authored-by: Nicolas AMBRY <nicolas.ambry@atos.net>
This commit is contained in:
1
tests/examples/map-syntax_case.Config
vendored
Normal file
1
tests/examples/map-syntax_case.Config
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"test": "value"}
|
@@ -2385,3 +2385,27 @@ fn lessopen_validity() {
|
||||
"\u{1b}[33m[bat warning]\u{1b}[0m: LESSOPEN ignored: must contain exactly one %s\n",
|
||||
);
|
||||
}
|
||||
|
||||
// Regression test for issue #2520 and PR #2650
|
||||
// Syntax highlighting should be the same regardless of
|
||||
// --map-syntax' case or file extension's case
|
||||
#[test]
|
||||
fn highlighting_independant_from_map_syntax_case() {
|
||||
let expected = bat()
|
||||
.arg("-f")
|
||||
.arg("--map-syntax=*.config:JSON")
|
||||
.arg("map-syntax_case.Config")
|
||||
.assert()
|
||||
.get_output()
|
||||
.stdout
|
||||
.clone();
|
||||
|
||||
bat()
|
||||
.arg("-f")
|
||||
.arg("--map-syntax=*.Config:JSON")
|
||||
.arg("map-syntax_case.Config")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(expected)
|
||||
.stderr("");
|
||||
}
|
||||
|
Reference in New Issue
Block a user