diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-10-05 16:25:56 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-10-05 16:25:56 -0400 |
commit | 5a16a1e2b33733f0e6dff4ddfaed2662c3ba7ccb (patch) | |
tree | cb02f87ca029b0f9a5e71fb47a06ad47e52868c6 | |
parent | 8ddd85627f537131e3c8fdd3957fd263dac3dffe (diff) | |
download | bfs-5a16a1e2b33733f0e6dff4ddfaed2662c3ba7ccb.tar.xz |
tests/bfs: Add tests for color autodetection
-rw-r--r-- | tests/bfs/color_auto.out | 27 | ||||
-rw-r--r-- | tests/bfs/color_auto.sh | 6 | ||||
-rw-r--r-- | tests/bfs/nocolor_env.out | 27 | ||||
-rw-r--r-- | tests/bfs/nocolor_env.sh | 5 |
4 files changed, 65 insertions, 0 deletions
diff --git a/tests/bfs/color_auto.out b/tests/bfs/color_auto.out new file mode 100644 index 0000000..a439814 --- /dev/null +++ b/tests/bfs/color_auto.out @@ -0,0 +1,27 @@ +[01;34m$'rainbow/\e[1m'[0m +[01;34m$'rainbow/\e[1m/'[0m$'\e[0m' +[01;34mrainbow[0m +[01;34mrainbow/[0m[01;32mexec.sh[0m +[01;34mrainbow/[0m[01;35msocket[0m +[01;34mrainbow/[0m[01;36mbroken[0m +[01;34mrainbow/[0m[01;36mchardev_link[0m +[01;34mrainbow/[0m[01;36mlink.txt[0m +[01;34mrainbow/[0m[30;42msticky_ow[0m +[01;34mrainbow/[0m[30;43msgid[0m +[01;34mrainbow/[0m[33mpipe[0m +[01;34mrainbow/[0m[34;42mow[0m +[01;34mrainbow/[0m[37;41msugid[0m +[01;34mrainbow/[0m[37;41msuid[0m +[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_auto.sh b/tests/bfs/color_auto.sh new file mode 100644 index 0000000..aa2eb02 --- /dev/null +++ b/tests/bfs/color_auto.sh @@ -0,0 +1,6 @@ +command -v unbuffer &>/dev/null || skip + +unset NO_COLOR +unbuffer "${BFS[@]}" rainbow >"$OUT" +sort_output +diff_output diff --git a/tests/bfs/nocolor_env.out b/tests/bfs/nocolor_env.out new file mode 100644 index 0000000..d51d24d --- /dev/null +++ b/tests/bfs/nocolor_env.out @@ -0,0 +1,27 @@ +rainbow +rainbow/[1m +rainbow/[1m/[0m +rainbow/broken +rainbow/chardev_link +rainbow/exec.sh +rainbow/file.dat +rainbow/file.txt +rainbow/link.txt +rainbow/lower.gz +rainbow/lower.tar +rainbow/lower.tar.gz +rainbow/lu.tar.GZ +rainbow/mh1 +rainbow/mh2 +rainbow/ow +rainbow/pipe +rainbow/sgid +rainbow/socket +rainbow/sticky +rainbow/sticky_ow +rainbow/sugid +rainbow/suid +rainbow/ul.TAR.gz +rainbow/upper.GZ +rainbow/upper.TAR +rainbow/upper.TAR.GZ diff --git a/tests/bfs/nocolor_env.sh b/tests/bfs/nocolor_env.sh new file mode 100644 index 0000000..399bdb0 --- /dev/null +++ b/tests/bfs/nocolor_env.sh @@ -0,0 +1,5 @@ +command -v unbuffer &>/dev/null || skip + +NO_COLOR=1 unbuffer "${BFS[@]}" rainbow >"$OUT" +sort_output +diff_output |