diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-06-29 15:17:27 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-06-29 15:33:28 -0400 |
commit | 27dc7a126d6c00b7a41e0559254928555200ee42 (patch) | |
tree | 0edd749507260ce972ea8ae462c796a6c2171d7e /tests/bfs | |
parent | 32cd0cbacfc6a4637915b40b7781976731599435 (diff) | |
download | bfs-27dc7a126d6c00b7a41e0559254928555200ee42.tar.xz |
color: Implement smart casing
Since coreutils 9.2, ls does case-sensitive extension matching if the
same extension is capitalized differently in $LS_COLORS. Implement the
same logic.
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33123
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=9086
Diffstat (limited to 'tests/bfs')
-rw-r--r-- | tests/bfs/color_ext_case.out (renamed from tests/bfs/color_star.out) | 16 | ||||
-rw-r--r-- | tests/bfs/color_ext_case.sh | 1 | ||||
-rw-r--r-- | tests/bfs/color_nul.out | bin | 20 -> 908 bytes | |||
-rw-r--r-- | tests/bfs/color_nul.sh | 3 | ||||
-rw-r--r-- | tests/bfs/color_star.sh | 2 |
5 files changed, 12 insertions, 10 deletions
diff --git a/tests/bfs/color_star.out b/tests/bfs/color_ext_case.out index 34c7153..c3ded3a 100644 --- a/tests/bfs/color_star.out +++ b/tests/bfs/color_ext_case.out @@ -1,5 +1,13 @@ [01;34mrainbow[0m +[01;34mrainbow/[0m[01;31mlower.gz[0m +[01;34mrainbow/[0m[01;31mlower.tar.gz[0m [01;34mrainbow/[0m[01;32mexec.sh[0m +[01;34mrainbow/[0m[01;32mupper.GZ[0m +[01;34mrainbow/[0m[01;32mupper.TAR.GZ[0m +[01;34mrainbow/[0m[01;33mlower.tar[0m +[01;34mrainbow/[0m[01;33mupper.TAR[0m +[01;34mrainbow/[0m[01;34mul.TAR.gz[0m +[01;34mrainbow/[0m[01;35mlu.tar.GZ[0m [01;34mrainbow/[0m[01;35msocket[0m [01;34mrainbow/[0m[01;36mbroken[0m [01;34mrainbow/[0m[01;36mchardev_link[0m @@ -13,13 +21,5 @@ [01;34mrainbow/[0m[37;44msticky[0m [01;34mrainbow/[0mfile.dat [01;34mrainbow/[0mfile.txt -[01;34mrainbow/[0mlower.gz -[01;34mrainbow/[0mlower.tar -[01;34mrainbow/[0mlower.tar.gz -[01;34mrainbow/[0mlu.tar.GZ [01;34mrainbow/[0mmh1 [01;34mrainbow/[0mmh2 -[01;34mrainbow/[0mul.TAR.gz -[01;34mrainbow/[0mupper.GZ -[01;34mrainbow/[0mupper.TAR -[01;34mrainbow/[0mupper.TAR.GZ diff --git a/tests/bfs/color_ext_case.sh b/tests/bfs/color_ext_case.sh new file mode 100644 index 0000000..91f1f59 --- /dev/null +++ b/tests/bfs/color_ext_case.sh @@ -0,0 +1 @@ +LS_COLORS="*.gz=01;31:*.GZ=01;32:*.tAr=01;33:*.TAR.gz=01;34:*.tar.GZ=01;35:" bfs_diff rainbow -color diff --git a/tests/bfs/color_nul.out b/tests/bfs/color_nul.out Binary files differindex c328f82..4ea4d85 100644 --- a/tests/bfs/color_nul.out +++ b/tests/bfs/color_nul.out diff --git a/tests/bfs/color_nul.sh b/tests/bfs/color_nul.sh index 4979569..cb662d6 100644 --- a/tests/bfs/color_nul.sh +++ b/tests/bfs/color_nul.sh @@ -1,2 +1,3 @@ -LS_COLORS="ec=\33[m\0:" invoke_bfs rainbow -color -maxdepth 0 >"$OUT" +LS_COLORS="ec=\33[\0m:*.gz=\0\61;31:" invoke_bfs rainbow -color | tr '\0' '0' >"$OUT" +sort_output diff_output diff --git a/tests/bfs/color_star.sh b/tests/bfs/color_star.sh index 3ada4fd..6d5312e 100644 --- a/tests/bfs/color_star.sh +++ b/tests/bfs/color_star.sh @@ -1,2 +1,2 @@ # Regression test: don't segfault on LS_COLORS="*" -LS_COLORS="*" bfs_diff rainbow -color +! LS_COLORS="*" invoke_bfs rainbow -color |