From 5a16a1e2b33733f0e6dff4ddfaed2662c3ba7ccb Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 5 Oct 2023 16:25:56 -0400 Subject: tests/bfs: Add tests for color autodetection --- tests/bfs/color_auto.out | 27 +++++++++++++++++++++++++++ tests/bfs/color_auto.sh | 6 ++++++ tests/bfs/nocolor_env.out | 27 +++++++++++++++++++++++++++ tests/bfs/nocolor_env.sh | 5 +++++ 4 files changed, 65 insertions(+) create mode 100644 tests/bfs/color_auto.out create mode 100644 tests/bfs/color_auto.sh create mode 100644 tests/bfs/nocolor_env.out create mode 100644 tests/bfs/nocolor_env.sh 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 @@ +$'rainbow/\e[1m' +$'rainbow/\e[1m/'$'\e[0m' +rainbow +rainbow/exec.sh +rainbow/socket +rainbow/broken +rainbow/chardev_link +rainbow/link.txt +rainbow/sticky_ow +rainbow/sgid +rainbow/pipe +rainbow/ow +rainbow/sugid +rainbow/suid +rainbow/sticky +rainbow/file.dat +rainbow/file.txt +rainbow/lower.gz +rainbow/lower.tar +rainbow/lower.tar.gz +rainbow/lu.tar.GZ +rainbow/mh1 +rainbow/mh2 +rainbow/ul.TAR.gz +rainbow/upper.GZ +rainbow/upper.TAR +rainbow/upper.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/ +rainbow// +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 -- cgit v1.2.3