summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-03-28 19:52:43 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-03-28 20:05:36 -0400
commite5b22d17d53119040ecef93312b850e9d3d6266d (patch)
tree03ff30ef7c97ccc923e27a828e6d2394b1cf3eef
parentb30242bd400462a74e98bcd79ab5e69831590198 (diff)
downloadbfs-e5b22d17d53119040ecef93312b850e9d3d6266d.tar.xz
tests: Fix color NUL byte test on platforms where sort expects text
-rwxr-xr-xtests.sh18
-rw-r--r--tests/test_color_escapes.outbin713 -> 681 bytes
-rw-r--r--tests/test_color_nul.outbin0 -> 20 bytes
3 files changed, 17 insertions, 1 deletions
diff --git a/tests.sh b/tests.sh
index 3b6c030..fc82ba3 100755
--- a/tests.sh
+++ b/tests.sh
@@ -628,6 +628,7 @@ bfs_tests=(
test_color_L
test_color_rs_lc_rc_ec
test_color_escapes
+ test_color_nul
test_color_ln_target
test_color_mh
test_color_mh0
@@ -1855,7 +1856,22 @@ function test_color_rs_lc_rc_ec() {
}
function test_color_escapes() {
- LS_COLORS="lc=\e[:rc=\x6d\::ec=^[[\x6D\0:" bfs_diff rainbow -color
+ LS_COLORS="lc=\e[:rc=\155\::ec=^[\x5B\x6d:" bfs_diff rainbow -color
+}
+
+function test_color_nul() {
+ local EXPECTED="$TESTS/${FUNCNAME[0]}.out"
+ if [ "$UPDATE" ]; then
+ local ACTUAL="$EXPECTED"
+ else
+ local ACTUAL="$TMP/${FUNCNAME[0]}.out"
+ fi
+
+ LS_COLORS="ec=\33[m\0:" invoke_bfs rainbow -color -maxdepth 0 >"$ACTUAL"
+
+ if [ ! "$UPDATE" ]; then
+ diff -u "$EXPECTED" "$ACTUAL"
+ fi
}
function test_color_ln_target() {
diff --git a/tests/test_color_escapes.out b/tests/test_color_escapes.out
index 9f1c663..b71e138 100644
--- a/tests/test_color_escapes.out
+++ b/tests/test_color_escapes.out
Binary files differ
diff --git a/tests/test_color_nul.out b/tests/test_color_nul.out
new file mode 100644
index 0000000..c328f82
--- /dev/null
+++ b/tests/test_color_nul.out
Binary files differ