summaryrefslogtreecommitdiffstats
path: root/tests/bfs
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-05-07 15:42:46 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-05-07 15:42:46 -0400
commit452d6697e0f92326ab139eed4eadd9c2fd8b55ca (patch)
tree0feeb3722dcf6debb6c33c5175342bf1d70a1dba /tests/bfs
parenta4299f9bc1d3e60a7e628561e8d650c2a241e1c2 (diff)
parentc5cf2cf90834f2f56b2940d2a499a1a614ebfd21 (diff)
downloadbfs-find2fd.tar.xz
Merge branch 'main' into find2fdfind2fd
Diffstat (limited to 'tests/bfs')
-rw-r--r--tests/bfs/D_incomplete.sh2
-rw-r--r--tests/bfs/D_opt.out7
-rw-r--r--tests/bfs/D_opt.sh1
-rw-r--r--tests/bfs/D_unknown.sh2
-rw-r--r--tests/bfs/L_capable.out4
-rw-r--r--tests/bfs/L_capable.sh16
-rw-r--r--tests/bfs/O9.sh2
-rw-r--r--tests/bfs/and_incomplete.sh2
-rw-r--r--tests/bfs/capable.out2
-rw-r--r--tests/bfs/capable.sh16
-rw-r--r--tests/bfs/closed_stderr.sh4
-rw-r--r--tests/bfs/closed_stdin.out19
-rw-r--r--tests/bfs/closed_stdin.sh1
-rw-r--r--tests/bfs/closed_stdout.sh4
-rw-r--r--tests/bfs/color.out13
-rw-r--r--tests/bfs/color_L.out13
-rw-r--r--tests/bfs/color_L_ln_target.out13
-rw-r--r--tests/bfs/color_L_no_stat.out19
-rw-r--r--tests/bfs/color_auto.out (renamed from tests/bfs/color_star.out)13
-rw-r--r--tests/bfs/color_auto.sh4
-rw-r--r--tests/bfs/color_cd0_no.out27
-rw-r--r--tests/bfs/color_cd0_no.sh1
-rw-r--r--tests/bfs/color_deep.out16
-rw-r--r--tests/bfs/color_deep.sh7
-rw-r--r--tests/bfs/color_escapes.out13
-rw-r--r--tests/bfs/color_ext.out13
-rw-r--r--tests/bfs/color_ext0.out13
-rw-r--r--tests/bfs/color_ext_case.out27
-rw-r--r--tests/bfs/color_ext_case.sh6
-rw-r--r--tests/bfs/color_ext_override.out13
-rw-r--r--tests/bfs/color_ext_underride.out13
-rw-r--r--tests/bfs/color_fi0_no.out27
-rw-r--r--tests/bfs/color_fi0_no.sh1
-rw-r--r--tests/bfs/color_fi_no.out27
-rw-r--r--tests/bfs/color_fi_no.sh1
-rw-r--r--tests/bfs/color_ln_target.out13
-rw-r--r--tests/bfs/color_ls.out16
-rw-r--r--tests/bfs/color_ls.sh8
-rw-r--r--tests/bfs/color_mh.out13
-rw-r--r--tests/bfs/color_mh0.out13
-rw-r--r--tests/bfs/color_mi.out13
-rw-r--r--tests/bfs/color_missing_colon.out13
-rw-r--r--tests/bfs/color_no.out27
-rw-r--r--tests/bfs/color_no.sh1
-rw-r--r--tests/bfs/color_no_stat.out19
-rw-r--r--tests/bfs/color_nul.outbin20 -> 975 bytes
-rw-r--r--tests/bfs/color_nul.sh3
-rw-r--r--tests/bfs/color_or.out13
-rw-r--r--tests/bfs/color_or0_mi.out13
-rw-r--r--tests/bfs/color_or0_mi0.out13
-rw-r--r--tests/bfs/color_or_mi.out13
-rw-r--r--tests/bfs/color_or_mi0.out13
-rw-r--r--tests/bfs/color_rs_lc_rc_ec.out13
-rw-r--r--tests/bfs/color_st0_tw0_ow.out15
-rw-r--r--tests/bfs/color_st0_tw0_ow0.out19
-rw-r--r--tests/bfs/color_st0_tw_ow.out15
-rw-r--r--tests/bfs/color_st0_tw_ow0.out17
-rw-r--r--tests/bfs/color_st_tw0_ow.out13
-rw-r--r--tests/bfs/color_st_tw0_ow0.out15
-rw-r--r--tests/bfs/color_st_tw_ow0.out15
-rw-r--r--tests/bfs/color_star.sh2
-rw-r--r--tests/bfs/color_su0_sg.out13
-rw-r--r--tests/bfs/color_su0_sg0.out13
-rw-r--r--tests/bfs/color_su_sg0.out13
-rw-r--r--tests/bfs/comma_incomplete.sh2
-rw-r--r--tests/bfs/deep_strict.sh4
-rw-r--r--tests/bfs/exclude_exclude.sh2
-rw-r--r--tests/bfs/exclude_print.sh2
-rw-r--r--tests/bfs/exec_flush_fprint.sh3
-rw-r--r--tests/bfs/exec_flush_fprint_fail.sh4
-rw-r--r--tests/bfs/execdir_plus.sh7
-rw-r--r--tests/bfs/execdir_plus_nonexistent.sh7
-rw-r--r--tests/bfs/fprint_error_stderr.sh4
-rw-r--r--tests/bfs/fprint_error_stdout.sh4
-rw-r--r--tests/bfs/help.sh10
-rw-r--r--tests/bfs/high_byte.sh2
-rw-r--r--tests/bfs/j0.sh1
-rw-r--r--tests/bfs/j1.out19
-rw-r--r--tests/bfs/j1.sh1
-rw-r--r--tests/bfs/j64.out19
-rw-r--r--tests/bfs/j64.sh1
-rw-r--r--tests/bfs/j_negative.sh1
-rw-r--r--tests/bfs/limit.out4
-rw-r--r--tests/bfs/limit.sh1
-rw-r--r--tests/bfs/limit_0.sh1
-rw-r--r--tests/bfs/limit_implicit_print.sh1
-rw-r--r--tests/bfs/limit_incomplete.sh1
-rw-r--r--tests/bfs/limit_one.sh1
-rw-r--r--tests/bfs/links_empty.sh2
-rw-r--r--tests/bfs/links_invalid.sh2
-rw-r--r--tests/bfs/links_leading_space.sh1
-rw-r--r--tests/bfs/links_negative.sh2
-rw-r--r--tests/bfs/links_noarg.sh2
-rw-r--r--tests/bfs/newerma_nonexistent.sh2
-rw-r--r--tests/bfs/newermq.sh2
-rw-r--r--tests/bfs/newermt_invalid.sh2
-rw-r--r--tests/bfs/newerqm.sh2
-rw-r--r--tests/bfs/nocolor.out13
-rw-r--r--tests/bfs/nocolor_env.out27
-rw-r--r--tests/bfs/nocolor_env.sh3
-rw-r--r--tests/bfs/nocolor_env_empty.out27
-rw-r--r--tests/bfs/nocolor_env_empty.sh3
-rw-r--r--tests/bfs/or_incomplete.sh2
-rw-r--r--tests/bfs/perm_symbolic_double_comma.sh2
-rw-r--r--tests/bfs/perm_symbolic_missing_action.sh2
-rw-r--r--tests/bfs/perm_symbolic_trailing_comma.sh2
-rw-r--r--tests/bfs/printf_color.out16
-rw-r--r--tests/bfs/printf_color.sh2
-rw-r--r--tests/bfs/printf_duplicate_flag.sh2
-rw-r--r--tests/bfs/printf_everything.sh4
-rw-r--r--tests/bfs/printf_incomplete_escape.sh2
-rw-r--r--tests/bfs/printf_incomplete_format.sh2
-rw-r--r--tests/bfs/printf_invalid_escape.sh2
-rw-r--r--tests/bfs/printf_invalid_format.sh2
-rw-r--r--tests/bfs/printf_must_be_numeric.sh2
-rw-r--r--tests/bfs/status.sh1
-rw-r--r--tests/bfs/stderr_fails_loudly.sh4
-rw-r--r--tests/bfs/stderr_fails_silently.sh2
-rw-r--r--tests/bfs/unexpected_operator.sh2
-rw-r--r--tests/bfs/warn_O9.out19
-rw-r--r--tests/bfs/warn_O9.sh3
-rw-r--r--tests/bfs/warn_xdev_mount.out19
-rw-r--r--tests/bfs/warn_xdev_mount.sh2
-rw-r--r--tests/bfs/xtype_depth.sh2
124 files changed, 803 insertions, 214 deletions
diff --git a/tests/bfs/D_incomplete.sh b/tests/bfs/D_incomplete.sh
index 396d365..30c522a 100644
--- a/tests/bfs/D_incomplete.sh
+++ b/tests/bfs/D_incomplete.sh
@@ -1 +1 @@
-fail invoke_bfs -D
+! invoke_bfs -D
diff --git a/tests/bfs/D_opt.out b/tests/bfs/D_opt.out
new file mode 100644
index 0000000..6218a0c
--- /dev/null
+++ b/tests/bfs/D_opt.out
@@ -0,0 +1,7 @@
+basic/a
+basic/b
+basic/c/d
+basic/e/f
+basic/j/foo
+basic/k/foo/bar
+basic/l/foo/bar/baz
diff --git a/tests/bfs/D_opt.sh b/tests/bfs/D_opt.sh
new file mode 100644
index 0000000..c14fe70
--- /dev/null
+++ b/tests/bfs/D_opt.sh
@@ -0,0 +1 @@
+bfs_diff -D opt -nohidden -not \( -type c -o -type d \) -links -5 -links -10 -not -hidden basic
diff --git a/tests/bfs/D_unknown.sh b/tests/bfs/D_unknown.sh
index e3614ba..cac9bd9 100644
--- a/tests/bfs/D_unknown.sh
+++ b/tests/bfs/D_unknown.sh
@@ -1,4 +1,4 @@
stderr=$(invoke_bfs -warn -D unknown basic 2>&1 >"$OUT")
-[ -n "$stderr" ] || return 1
+[ -n "$stderr" ]
sort_output
diff_output
diff --git a/tests/bfs/L_capable.out b/tests/bfs/L_capable.out
index e5ba3c7..0810d4a 100644
--- a/tests/bfs/L_capable.out
+++ b/tests/bfs/L_capable.out
@@ -1,2 +1,2 @@
-scratch/capable
-scratch/link
+./capable
+./link
diff --git a/tests/bfs/L_capable.sh b/tests/bfs/L_capable.sh
index 533ac2f..97c404f 100644
--- a/tests/bfs/L_capable.sh
+++ b/tests/bfs/L_capable.sh
@@ -1,12 +1,10 @@
-skip_unless test "$SUDO"
-skip_unless test "$UNAME" = "Linux"
+test "$UNAME" = "Linux" || skip
+invoke_bfs . -quit -capable || skip
-clean_scratch
+cd "$TEST"
-skip_unless invoke_bfs scratch -quit -capable
+"$XTOUCH" normal capable
+bfs_sudo setcap all+ep capable || skip
+ln -s capable link
-"$XTOUCH" scratch/{normal,capable}
-sudo setcap all+ep scratch/capable
-ln -s capable scratch/link
-
-bfs_diff -L scratch -capable
+bfs_diff -L . -capable
diff --git a/tests/bfs/O9.sh b/tests/bfs/O9.sh
index 12f6c2d..c12a7a3 100644
--- a/tests/bfs/O9.sh
+++ b/tests/bfs/O9.sh
@@ -1,4 +1,4 @@
stderr=$(invoke_bfs -warn -O9 basic 2>&1 >"$OUT")
-[ -n "$stderr" ] || return 1
+[ -n "$stderr" ]
sort_output
diff_output
diff --git a/tests/bfs/and_incomplete.sh b/tests/bfs/and_incomplete.sh
index f7bc2c3..05abc2d 100644
--- a/tests/bfs/and_incomplete.sh
+++ b/tests/bfs/and_incomplete.sh
@@ -1 +1 @@
-fail invoke_bfs -print -a
+! invoke_bfs -print -a
diff --git a/tests/bfs/capable.out b/tests/bfs/capable.out
index 78b5bd9..ac7b5ce 100644
--- a/tests/bfs/capable.out
+++ b/tests/bfs/capable.out
@@ -1 +1 @@
-scratch/capable
+./capable
diff --git a/tests/bfs/capable.sh b/tests/bfs/capable.sh
index 256b9bc..35bb0b4 100644
--- a/tests/bfs/capable.sh
+++ b/tests/bfs/capable.sh
@@ -1,12 +1,10 @@
-skip_unless test "$SUDO"
-skip_unless test "$UNAME" = "Linux"
+test "$UNAME" = "Linux" || skip
+invoke_bfs . -quit -capable || skip
-clean_scratch
+cd "$TEST"
-skip_unless invoke_bfs scratch -quit -capable
+"$XTOUCH" normal capable
+bfs_sudo setcap all+ep capable || skip
+ln -s capable link
-"$XTOUCH" scratch/{normal,capable}
-sudo setcap all+ep scratch/capable
-ln -s capable scratch/link
-
-bfs_diff scratch -capable
+bfs_diff . -capable
diff --git a/tests/bfs/closed_stderr.sh b/tests/bfs/closed_stderr.sh
new file mode 100644
index 0000000..26abd85
--- /dev/null
+++ b/tests/bfs/closed_stderr.sh
@@ -0,0 +1,4 @@
+# Check if the platform automatically re-opens stderr before we can
+(bash -c 'echo >&2' 2>&-) && skip
+
+! invoke_bfs basic >&- 2>&-
diff --git a/tests/bfs/closed_stdin.out b/tests/bfs/closed_stdin.out
new file mode 100644
index 0000000..a7ccfe4
--- /dev/null
+++ b/tests/bfs/closed_stdin.out
@@ -0,0 +1,19 @@
+basic
+basic/a
+basic/b
+basic/c
+basic/c/d
+basic/e
+basic/e/f
+basic/g
+basic/g/h
+basic/i
+basic/j
+basic/j/foo
+basic/k
+basic/k/foo
+basic/k/foo/bar
+basic/l
+basic/l/foo
+basic/l/foo/bar
+basic/l/foo/bar/baz
diff --git a/tests/bfs/closed_stdin.sh b/tests/bfs/closed_stdin.sh
new file mode 100644
index 0000000..6932be8
--- /dev/null
+++ b/tests/bfs/closed_stdin.sh
@@ -0,0 +1 @@
+bfs_diff basic <&-
diff --git a/tests/bfs/closed_stdout.sh b/tests/bfs/closed_stdout.sh
new file mode 100644
index 0000000..5b6f7c3
--- /dev/null
+++ b/tests/bfs/closed_stdout.sh
@@ -0,0 +1,4 @@
+# Check if the platform automatically re-opens stdout before we can
+(bash -c echo >&-) && skip
+
+! invoke_bfs basic >&-
diff --git a/tests/bfs/color.out b/tests/bfs/color.out
index 77fc8a8..a439814 100644
--- a/tests/bfs/color.out
+++ b/tests/bfs/color.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_L.out b/tests/bfs/color_L.out
index b60dd4a..85923db 100644
--- a/tests/bfs/color_L.out
+++ b/tests/bfs/color_L.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/chardev_link
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_L_ln_target.out b/tests/bfs/color_L_ln_target.out
index cd4ec5e..23fe8d7 100644
--- a/tests/bfs/color_L_ln_target.out
+++ b/tests/bfs/color_L_ln_target.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/broken
rainbow/exec.sh
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_L_no_stat.out b/tests/bfs/color_L_no_stat.out
index c0bb1be..72e0319 100644
--- a/tests/bfs/color_L_no_stat.out
+++ b/tests/bfs/color_L_no_stat.out
@@ -1,8 +1,7 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/chardev_link
-rainbow/ow
-rainbow/sticky
-rainbow/sticky_ow
rainbow/socket
rainbow/broken
rainbow/file.txt
@@ -10,11 +9,19 @@
rainbow/pipe
rainbow/exec.sh
rainbow/file.dat
+rainbow/lower.gz
+rainbow/lower.tar
+rainbow/lower.tar.gz
+rainbow/lu.tar.GZ
rainbow/mh1
rainbow/mh2
rainbow/sgid
-rainbow/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
rainbow/sugid
rainbow/suid
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
+rainbow/ow
+rainbow/sticky
+rainbow/sticky_ow
diff --git a/tests/bfs/color_star.out b/tests/bfs/color_auto.out
index 77fc8a8..a439814 100644
--- a/tests/bfs/color_star.out
+++ b/tests/bfs/color_auto.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+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..7e875cc
--- /dev/null
+++ b/tests/bfs/color_auto.sh
@@ -0,0 +1,4 @@
+unset NO_COLOR
+bfs_pty rainbow >"$OUT"
+sort_output
+diff_output
diff --git a/tests/bfs/color_cd0_no.out b/tests/bfs/color_cd0_no.out
new file mode 100644
index 0000000..37b3fbc
--- /dev/null
+++ b/tests/bfs/color_cd0_no.out
@@ -0,0 +1,27 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
+rainbow
+rainbow/exec.sh
+rainbow/socket
+rainbow/broken
+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/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
+rainbow/sticky_ow
+rainbow/sgid
+rainbow/pipe
+rainbow/ow
+rainbow/sugid
+rainbow/suid
+rainbow/sticky
+rainbow/chardev_link
diff --git a/tests/bfs/color_cd0_no.sh b/tests/bfs/color_cd0_no.sh
new file mode 100644
index 0000000..325a782
--- /dev/null
+++ b/tests/bfs/color_cd0_no.sh
@@ -0,0 +1 @@
+LS_COLORS="ln=target:cd=0:no=01;92:" bfs_diff rainbow -color
diff --git a/tests/bfs/color_deep.out b/tests/bfs/color_deep.out
new file mode 100644
index 0000000..fb990d5
--- /dev/null
+++ b/tests/bfs/color_deep.out
@@ -0,0 +1,16 @@
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE
diff --git a/tests/bfs/color_deep.sh b/tests/bfs/color_deep.sh
new file mode 100644
index 0000000..a83ee0e
--- /dev/null
+++ b/tests/bfs/color_deep.sh
@@ -0,0 +1,7 @@
+name="0123456789ABCDEF"
+name="${name}${name}${name}${name}"
+name="${name}${name}${name}${name}"
+name="${name:0:255}"
+export LS_COLORS="*${name}=01:"
+
+bfs_diff deep -color -type f -printf '%f\n'
diff --git a/tests/bfs/color_escapes.out b/tests/bfs/color_escapes.out
index b71e138..0bf9fbb 100644
--- a/tests/bfs/color_escapes.out
+++ b/tests/bfs/color_escapes.out
@@ -1,3 +1,5 @@
+:$'rainbow/\e[1m'
+:$'rainbow/\e[1m/'$'\e[0m'
:rainbow
:rainbow/:exec.sh
:rainbow/:socket
@@ -13,8 +15,13 @@
: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/star.gz
-:rainbow/star.tar
-:rainbow/star.tar.gz
+:rainbow/ul.TAR.gz
+:rainbow/upper.GZ
+:rainbow/upper.TAR
+:rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_ext.out b/tests/bfs/color_ext.out
index cf26e73..218100f 100644
--- a/tests/bfs/color_ext.out
+++ b/tests/bfs/color_ext.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -13,8 +15,13 @@
rainbow/suid
rainbow/sticky
rainbow/file.dat
+rainbow/lower.gz
+rainbow/lower.tar
+rainbow/lower.tar.gz
+rainbow/lu.tar.GZ
rainbow/mh1
rainbow/mh2
-rainbow/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_ext0.out b/tests/bfs/color_ext0.out
index e764a6b..d2a7fd5 100644
--- a/tests/bfs/color_ext0.out
+++ b/tests/bfs/color_ext0.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/file.txt
rainbow/exec.sh
@@ -13,8 +15,13 @@
rainbow/suid
rainbow/sticky
rainbow/file.dat
+rainbow/lower.gz
+rainbow/lower.tar
+rainbow/lower.tar.gz
+rainbow/lu.tar.GZ
rainbow/mh1
rainbow/mh2
-rainbow/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_ext_case.out b/tests/bfs/color_ext_case.out
new file mode 100644
index 0000000..93dc8f6
--- /dev/null
+++ b/tests/bfs/color_ext_case.out
@@ -0,0 +1,27 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
+rainbow
+rainbow/lower.gz
+rainbow/lower.tar.gz
+rainbow/exec.sh
+rainbow/upper.GZ
+rainbow/upper.TAR.GZ
+rainbow/lower.tar
+rainbow/upper.TAR
+rainbow/ul.TAR.gz
+rainbow/lu.tar.GZ
+rainbow/socket
+rainbow/broken
+rainbow/chardev_link
+rainbow/link.txt
+rainbow/sticky_ow
+rainbow/sgid
+rainbow/pipe
+rainbow/ow
+rainbow/file.txt
+rainbow/sugid
+rainbow/suid
+rainbow/sticky
+rainbow/file.dat
+rainbow/mh1
+rainbow/mh2
diff --git a/tests/bfs/color_ext_case.sh b/tests/bfs/color_ext_case.sh
new file mode 100644
index 0000000..4adba69
--- /dev/null
+++ b/tests/bfs/color_ext_case.sh
@@ -0,0 +1,6 @@
+# *.gz=01;31:*.GZ=01;32 -- case sensitive
+# *.tAr=01;33:*.TaR=01;33 -- case-insensitive
+# *.TAR.gz=01;34:*.tar.GZ=01;35 -- case-sensitive
+# *.txt=35:*TXT=36 -- case-insensitive
+export LS_COLORS="*.gz=01;31:*.GZ=01;32:*.tAr=01;33:*.TaR=01;33:*.TAR.gz=01;34:*.tar.GZ=01;35:*.txt=35:*TXT=36"
+bfs_diff rainbow -color
diff --git a/tests/bfs/color_ext_override.out b/tests/bfs/color_ext_override.out
index 1377b65..0acfcbc 100644
--- a/tests/bfs/color_ext_override.out
+++ b/tests/bfs/color_ext_override.out
@@ -1,8 +1,15 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
-rainbow/star.tar
-rainbow/star.gz
-rainbow/star.tar.gz
+rainbow/lower.tar
+rainbow/upper.TAR
+rainbow/lower.gz
+rainbow/lower.tar.gz
+rainbow/lu.tar.GZ
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR.GZ
rainbow/socket
rainbow/broken
rainbow/chardev_link
diff --git a/tests/bfs/color_ext_underride.out b/tests/bfs/color_ext_underride.out
index 787248a..5c98341 100644
--- a/tests/bfs/color_ext_underride.out
+++ b/tests/bfs/color_ext_underride.out
@@ -1,8 +1,15 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
-rainbow/star.tar.gz
+rainbow/lower.tar.gz
+rainbow/lu.tar.GZ
+rainbow/ul.TAR.gz
+rainbow/upper.TAR.GZ
rainbow/exec.sh
-rainbow/star.tar
-rainbow/star.gz
+rainbow/lower.tar
+rainbow/upper.TAR
+rainbow/lower.gz
+rainbow/upper.GZ
rainbow/socket
rainbow/broken
rainbow/chardev_link
diff --git a/tests/bfs/color_fi0_no.out b/tests/bfs/color_fi0_no.out
new file mode 100644
index 0000000..a439814
--- /dev/null
+++ b/tests/bfs/color_fi0_no.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_fi0_no.sh b/tests/bfs/color_fi0_no.sh
new file mode 100644
index 0000000..f947d64
--- /dev/null
+++ b/tests/bfs/color_fi0_no.sh
@@ -0,0 +1 @@
+LS_COLORS="fi=0:no=01;92:" bfs_diff rainbow -color
diff --git a/tests/bfs/color_fi_no.out b/tests/bfs/color_fi_no.out
new file mode 100644
index 0000000..1c1ad8e
--- /dev/null
+++ b/tests/bfs/color_fi_no.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/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
+rainbow/sticky_ow
+rainbow/sgid
+rainbow/pipe
+rainbow/ow
+rainbow/sugid
+rainbow/suid
+rainbow/sticky
diff --git a/tests/bfs/color_fi_no.sh b/tests/bfs/color_fi_no.sh
new file mode 100644
index 0000000..c2b4ec7
--- /dev/null
+++ b/tests/bfs/color_fi_no.sh
@@ -0,0 +1 @@
+LS_COLORS="fi=01;91:no=01;92:" bfs_diff rainbow -color
diff --git a/tests/bfs/color_ln_target.out b/tests/bfs/color_ln_target.out
index cd4ec5e..23fe8d7 100644
--- a/tests/bfs/color_ln_target.out
+++ b/tests/bfs/color_ln_target.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/broken
rainbow/exec.sh
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_ls.out b/tests/bfs/color_ls.out
index b08d894..f69eb9c 100644
--- a/tests/bfs/color_ls.out
+++ b/tests/bfs/color_ls.out
@@ -1,12 +1,12 @@
-scratch/foo/bar
-scratch/foo/bar
-/__bfs__/nowhere
-/__bfs__/nowhere
-foo/bar/baz/qux
-foo/bar/baz/qux
+scratch/foo/bar
+scratch/foo/bar
+/__bfs__/nowhere
+/__bfs__/nowhere
foo/bar/nowhere
foo/bar/nowhere
-foo/bar/nowhere/nothing
-foo/bar/nowhere/nothing
+foo/bar/nowhere/nothing
+foo/bar/nowhere/nothing
foo/bar/baz
foo/bar/baz
+foo/bar/baz//qux
+foo/bar/baz//qux
diff --git a/tests/bfs/color_ls.sh b/tests/bfs/color_ls.sh
index 37d088f..f1cc216 100644
--- a/tests/bfs/color_ls.sh
+++ b/tests/bfs/color_ls.sh
@@ -1,15 +1,15 @@
-clean_scratch
+cd "$TEST"
"$XTOUCH" -p scratch/foo/bar/baz
ln -s foo/bar/baz scratch/link
ln -s foo/bar/nowhere scratch/broken
ln -s foo/bar/nowhere/nothing scratch/nested
-ln -s foo/bar/baz/qux scratch/notdir
+ln -s foo/bar/baz//qux scratch/notdir
ln -s scratch/foo/bar scratch/relative
mkdir scratch/__bfs__
ln -s /__bfs__/nowhere scratch/absolute
-LS_COLORS="or=01;31:" invoke_bfs scratch/{,link,broken,nested,notdir,relative,absolute} -color -type l -ls \
+export LS_COLORS="or=01;31:"
+invoke_bfs scratch/{,link,broken,nested,notdir,relative,absolute} -color -type l -ls \
| sed 's/.* -> //' \
| sort >"$OUT"
-
diff_output
diff --git a/tests/bfs/color_mh.out b/tests/bfs/color_mh.out
index 757a6a1..c658082 100644
--- a/tests/bfs/color_mh.out
+++ b/tests/bfs/color_mh.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -15,6 +17,11 @@
rainbow/sticky
rainbow/file.dat
rainbow/file.txt
-rainbow/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/lower.gz
+rainbow/lower.tar
+rainbow/lower.tar.gz
+rainbow/lu.tar.GZ
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_mh0.out b/tests/bfs/color_mh0.out
index 77fc8a8..a439814 100644
--- a/tests/bfs/color_mh0.out
+++ b/tests/bfs/color_mh0.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_mi.out b/tests/bfs/color_mi.out
index 77fc8a8..a439814 100644
--- a/tests/bfs/color_mi.out
+++ b/tests/bfs/color_mi.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_missing_colon.out b/tests/bfs/color_missing_colon.out
index cf26e73..218100f 100644
--- a/tests/bfs/color_missing_colon.out
+++ b/tests/bfs/color_missing_colon.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -13,8 +15,13 @@
rainbow/suid
rainbow/sticky
rainbow/file.dat
+rainbow/lower.gz
+rainbow/lower.tar
+rainbow/lower.tar.gz
+rainbow/lu.tar.GZ
rainbow/mh1
rainbow/mh2
-rainbow/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_no.out b/tests/bfs/color_no.out
new file mode 100644
index 0000000..67e1eee
--- /dev/null
+++ b/tests/bfs/color_no.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/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
+rainbow/sticky_ow
+rainbow/sgid
+rainbow/pipe
+rainbow/ow
+rainbow/sugid
+rainbow/suid
+rainbow/sticky
diff --git a/tests/bfs/color_no.sh b/tests/bfs/color_no.sh
new file mode 100644
index 0000000..b7527cb
--- /dev/null
+++ b/tests/bfs/color_no.sh
@@ -0,0 +1 @@
+LS_COLORS="no=01;92:" bfs_diff rainbow -color
diff --git a/tests/bfs/color_no_stat.out b/tests/bfs/color_no_stat.out
index 1fc5324..e3031b2 100644
--- a/tests/bfs/color_no_stat.out
+++ b/tests/bfs/color_no_stat.out
@@ -1,7 +1,6 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
-rainbow/ow
-rainbow/sticky
-rainbow/sticky_ow
rainbow/socket
rainbow/broken
rainbow/chardev_link
@@ -10,11 +9,19 @@
rainbow/pipe
rainbow/exec.sh
rainbow/file.dat
+rainbow/lower.gz
+rainbow/lower.tar
+rainbow/lower.tar.gz
+rainbow/lu.tar.GZ
rainbow/mh1
rainbow/mh2
rainbow/sgid
-rainbow/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
rainbow/sugid
rainbow/suid
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
+rainbow/ow
+rainbow/sticky
+rainbow/sticky_ow
diff --git a/tests/bfs/color_nul.out b/tests/bfs/color_nul.out
index c328f82..8ccd9a7 100644
--- a/tests/bfs/color_nul.out
+++ b/tests/bfs/color_nul.out
Binary files differ
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_or.out b/tests/bfs/color_or.out
index 9e1fe5c..0bd2570 100644
--- a/tests/bfs/color_or.out
+++ b/tests/bfs/color_or.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_or0_mi.out b/tests/bfs/color_or0_mi.out
index 77fc8a8..a439814 100644
--- a/tests/bfs/color_or0_mi.out
+++ b/tests/bfs/color_or0_mi.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_or0_mi0.out b/tests/bfs/color_or0_mi0.out
index 77fc8a8..a439814 100644
--- a/tests/bfs/color_or0_mi0.out
+++ b/tests/bfs/color_or0_mi0.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_or_mi.out b/tests/bfs/color_or_mi.out
index 5667f56..fb67e58 100644
--- a/tests/bfs/color_or_mi.out
+++ b/tests/bfs/color_or_mi.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/broken
rainbow/exec.sh
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_or_mi0.out b/tests/bfs/color_or_mi0.out
index 5667f56..fb67e58 100644
--- a/tests/bfs/color_or_mi0.out
+++ b/tests/bfs/color_or_mi0.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/broken
rainbow/exec.sh
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_rs_lc_rc_ec.out b/tests/bfs/color_rs_lc_rc_ec.out
index d39bbe7..077ef8d 100644
--- a/tests/bfs/color_rs_lc_rc_ec.out
+++ b/tests/bfs/color_rs_lc_rc_ec.out
@@ -1,3 +1,5 @@
+LC01;34RC$'rainbow/\e[1m'EC
+LC01;34RC$'rainbow/\e[1m/'EC$'\e[0m'
LC01;34RCrainbow/ECLC01;32RCexec.shEC
LC01;34RCrainbow/ECLC01;35RCsocketEC
LC01;34RCrainbow/ECLC01;36RCbrokenEC
@@ -12,9 +14,14 @@ LC01;34RCrainbow/ECLC37;41RCsuidEC
LC01;34RCrainbow/ECLC37;44RCstickyEC
LC01;34RCrainbow/ECfile.dat
LC01;34RCrainbow/ECfile.txt
+LC01;34RCrainbow/EClower.gz
+LC01;34RCrainbow/EClower.tar
+LC01;34RCrainbow/EClower.tar.gz
+LC01;34RCrainbow/EClu.tar.GZ
LC01;34RCrainbow/ECmh1
LC01;34RCrainbow/ECmh2
-LC01;34RCrainbow/ECstar.gz
-LC01;34RCrainbow/ECstar.tar
-LC01;34RCrainbow/ECstar.tar.gz
+LC01;34RCrainbow/ECul.TAR.gz
+LC01;34RCrainbow/ECupper.GZ
+LC01;34RCrainbow/ECupper.TAR
+LC01;34RCrainbow/ECupper.TAR.GZ
LC01;34RCrainbowEC
diff --git a/tests/bfs/color_st0_tw0_ow.out b/tests/bfs/color_st0_tw0_ow.out
index 9a47ef2..a82762b 100644
--- a/tests/bfs/color_st0_tw0_ow.out
+++ b/tests/bfs/color_st0_tw0_ow.out
@@ -1,6 +1,7 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
-rainbow/sticky
rainbow/socket
rainbow/broken
rainbow/chardev_link
@@ -13,8 +14,14 @@
rainbow/suid
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
+rainbow/sticky
diff --git a/tests/bfs/color_st0_tw0_ow0.out b/tests/bfs/color_st0_tw0_ow0.out
index 2b86fe4..041f1d4 100644
--- a/tests/bfs/color_st0_tw0_ow0.out
+++ b/tests/bfs/color_st0_tw0_ow0.out
@@ -1,8 +1,7 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
-rainbow/ow
-rainbow/sticky
-rainbow/sticky_ow
rainbow/socket
rainbow/broken
rainbow/chardev_link
@@ -13,8 +12,16 @@
rainbow/suid
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
+rainbow/ow
+rainbow/sticky
+rainbow/sticky_ow
diff --git a/tests/bfs/color_st0_tw_ow.out b/tests/bfs/color_st0_tw_ow.out
index 42549a1..4dcb2f2 100644
--- a/tests/bfs/color_st0_tw_ow.out
+++ b/tests/bfs/color_st0_tw_ow.out
@@ -1,6 +1,7 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
-rainbow/sticky
rainbow/socket
rainbow/broken
rainbow/chardev_link
@@ -13,8 +14,14 @@
rainbow/sticky_ow
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
+rainbow/sticky
diff --git a/tests/bfs/color_st0_tw_ow0.out b/tests/bfs/color_st0_tw_ow0.out
index 535b8ae..954ce9c 100644
--- a/tests/bfs/color_st0_tw_ow0.out
+++ b/tests/bfs/color_st0_tw_ow0.out
@@ -1,7 +1,7 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
-rainbow/ow
-rainbow/sticky
rainbow/socket
rainbow/broken
rainbow/chardev_link
@@ -13,8 +13,15 @@
rainbow/sticky_ow
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
+rainbow/ow
+rainbow/sticky
diff --git a/tests/bfs/color_st_tw0_ow.out b/tests/bfs/color_st_tw0_ow.out
index c9a86f4..a6e9a16 100644
--- a/tests/bfs/color_st_tw0_ow.out
+++ b/tests/bfs/color_st_tw0_ow.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -13,8 +15,13 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_st_tw0_ow0.out b/tests/bfs/color_st_tw0_ow0.out
index 2d94f3a..756dafb 100644
--- a/tests/bfs/color_st_tw0_ow0.out
+++ b/tests/bfs/color_st_tw0_ow0.out
@@ -1,6 +1,7 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
-rainbow/ow
rainbow/socket
rainbow/broken
rainbow/chardev_link
@@ -13,8 +14,14 @@
rainbow/sticky_ow
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
+rainbow/ow
diff --git a/tests/bfs/color_st_tw_ow0.out b/tests/bfs/color_st_tw_ow0.out
index 317ef90..6e4a260 100644
--- a/tests/bfs/color_st_tw_ow0.out
+++ b/tests/bfs/color_st_tw_ow0.out
@@ -1,6 +1,7 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
-rainbow/ow
rainbow/socket
rainbow/broken
rainbow/chardev_link
@@ -13,8 +14,14 @@
rainbow/sticky_ow
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
+rainbow/ow
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
diff --git a/tests/bfs/color_su0_sg.out b/tests/bfs/color_su0_sg.out
index 8b8c8b8..d13b6b6 100644
--- a/tests/bfs/color_su0_sg.out
+++ b/tests/bfs/color_su0_sg.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -12,9 +14,14 @@
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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
rainbow/suid
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_su0_sg0.out b/tests/bfs/color_su0_sg0.out
index 0cd5f9a..77fba58 100644
--- a/tests/bfs/color_su0_sg0.out
+++ b/tests/bfs/color_su0_sg0.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -10,11 +12,16 @@
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/sgid
-rainbow/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
rainbow/sugid
rainbow/suid
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/color_su_sg0.out b/tests/bfs/color_su_sg0.out
index a9e8c5d..8fab046 100644
--- a/tests/bfs/color_su_sg0.out
+++ b/tests/bfs/color_su_sg0.out
@@ -1,3 +1,5 @@
+$'rainbow/\e[1m'
+$'rainbow/\e[1m/'$'\e[0m'
rainbow
rainbow/exec.sh
rainbow/socket
@@ -12,9 +14,14 @@
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/sgid
-rainbow/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
+rainbow/ul.TAR.gz
+rainbow/upper.GZ
+rainbow/upper.TAR
+rainbow/upper.TAR.GZ
diff --git a/tests/bfs/comma_incomplete.sh b/tests/bfs/comma_incomplete.sh
index 07cf505..bd60168 100644
--- a/tests/bfs/comma_incomplete.sh
+++ b/tests/bfs/comma_incomplete.sh
@@ -1 +1 @@
-fail invoke_bfs -print ,
+! invoke_bfs -print ,
diff --git a/tests/bfs/deep_strict.sh b/tests/bfs/deep_strict.sh
index e057310..22453c0 100644
--- a/tests/bfs/deep_strict.sh
+++ b/tests/bfs/deep_strict.sh
@@ -1,5 +1,3 @@
-closefrom 4
-
# Not even enough fds to keep the root open
-ulimit -n 7
+ulimit -n $((NOPENFD + 4))
bfs_diff deep -type f -exec bash -c 'echo "${1:0:6}/.../${1##*/} (${#1})"' bash {} \;
diff --git a/tests/bfs/exclude_exclude.sh b/tests/bfs/exclude_exclude.sh
index c687623..739342f 100644
--- a/tests/bfs/exclude_exclude.sh
+++ b/tests/bfs/exclude_exclude.sh
@@ -1 +1 @@
-fail invoke_bfs basic -exclude -exclude -name foo
+! invoke_bfs basic -exclude -exclude -name foo
diff --git a/tests/bfs/exclude_print.sh b/tests/bfs/exclude_print.sh
index 52ff0fd..dc89e1d 100644
--- a/tests/bfs/exclude_print.sh
+++ b/tests/bfs/exclude_print.sh
@@ -1 +1 @@
-fail invoke_bfs basic -exclude -print
+! invoke_bfs basic -exclude -print
diff --git a/tests/bfs/exec_flush_fprint.sh b/tests/bfs/exec_flush_fprint.sh
index bf6b62f..a862773 100644
--- a/tests/bfs/exec_flush_fprint.sh
+++ b/tests/bfs/exec_flush_fprint.sh
@@ -1,3 +1,2 @@
# Even non-stdstreams should be flushed
-clean_scratch
-bfs_diff basic/a -fprint scratch/foo -exec cat scratch/foo \;
+bfs_diff basic/a -fprint "$OUT.f" -exec cat "$OUT.f" \;
diff --git a/tests/bfs/exec_flush_fprint_fail.sh b/tests/bfs/exec_flush_fprint_fail.sh
index 5da944a..cd38e41 100644
--- a/tests/bfs/exec_flush_fprint_fail.sh
+++ b/tests/bfs/exec_flush_fprint_fail.sh
@@ -1,2 +1,2 @@
-skip_unless test -e /dev/full
-fail invoke_bfs basic/a -fprint /dev/full -exec true \;
+test -e /dev/full || skip
+! invoke_bfs basic/a -fprint /dev/full -exec true \;
diff --git a/tests/bfs/execdir_plus.sh b/tests/bfs/execdir_plus.sh
index 9ae7764..6f24bdc 100644
--- a/tests/bfs/execdir_plus.sh
+++ b/tests/bfs/execdir_plus.sh
@@ -1,7 +1,4 @@
tree=$(invoke_bfs -D tree 2>&1 -quit)
+[[ "$tree" == *"-S dfs"* ]] && skip
-if [[ "$tree" == *"-S dfs"* ]]; then
- skip
-fi
-
-bfs_diff basic -execdir "$TESTS/sort-args.sh" {} +
+bfs_diff -j1 basic -execdir "$TESTS/sort-args.sh" {} +
diff --git a/tests/bfs/execdir_plus_nonexistent.sh b/tests/bfs/execdir_plus_nonexistent.sh
index 8436953..ed7ed56 100644
--- a/tests/bfs/execdir_plus_nonexistent.sh
+++ b/tests/bfs/execdir_plus_nonexistent.sh
@@ -1,5 +1,2 @@
-stderr=$(invoke_bfs basic -execdir "$TESTS/nonexistent" {} + 2>&1 >/dev/null)
-[ -n "$stderr" ] || return 1
-
-bfs_diff basic -execdir "$TESTS/nonexistent" {} + -print
-(($? == EX_BFS))
+bfs_diff basic -execdir "$TESTS/nonexistent" {} + -print 2>"$TEST/err" && fail
+test -s "$TEST/err"
diff --git a/tests/bfs/fprint_error_stderr.sh b/tests/bfs/fprint_error_stderr.sh
index 427808f..2cc4037 100644
--- a/tests/bfs/fprint_error_stderr.sh
+++ b/tests/bfs/fprint_error_stderr.sh
@@ -1,2 +1,2 @@
-skip_unless test -e /dev/full
-fail invoke_bfs basic -maxdepth 0 -fprint /dev/full 2>/dev/full
+test -e /dev/full || skip
+! invoke_bfs basic -maxdepth 0 -fprint /dev/full 2>/dev/full
diff --git a/tests/bfs/fprint_error_stdout.sh b/tests/bfs/fprint_error_stdout.sh
index fbdc1d0..42a7b36 100644
--- a/tests/bfs/fprint_error_stdout.sh
+++ b/tests/bfs/fprint_error_stdout.sh
@@ -1,2 +1,2 @@
-skip_unless test -e /dev/full
-fail invoke_bfs basic -maxdepth 0 -fprint /dev/full >/dev/full
+test -e /dev/full || skip
+! invoke_bfs basic -maxdepth 0 -fprint /dev/full >/dev/full
diff --git a/tests/bfs/help.sh b/tests/bfs/help.sh
index 5e5c684..5029c7e 100644
--- a/tests/bfs/help.sh
+++ b/tests/bfs/help.sh
@@ -1,6 +1,4 @@
-invoke_bfs -help | grep -E '\{...?\}' && return 1
-invoke_bfs -D help | grep -E '\{...?\}' && return 1
-invoke_bfs -S help | grep -E '\{...?\}' && return 1
-invoke_bfs -regextype help | grep -E '\{...?\}' && return 1
-
-return 0
+! invoke_bfs -help | grep -E '\{...?\}' || fail
+! invoke_bfs -D help | grep -E '\{...?\}' || fail
+! invoke_bfs -S help | grep -E '\{...?\}' || fail
+! invoke_bfs -regextype help | grep -E '\{...?\}' || fail
diff --git a/tests/bfs/high_byte.sh b/tests/bfs/high_byte.sh
index 222f24b..c76199f 100644
--- a/tests/bfs/high_byte.sh
+++ b/tests/bfs/high_byte.sh
@@ -1 +1 @@
-fail invoke_bfs -$'\xFF'
+! invoke_bfs -$'\xFF'
diff --git a/tests/bfs/j0.sh b/tests/bfs/j0.sh
new file mode 100644
index 0000000..97a7c5c
--- /dev/null
+++ b/tests/bfs/j0.sh
@@ -0,0 +1 @@
+! invoke_bfs -j0 basic
diff --git a/tests/bfs/j1.out b/tests/bfs/j1.out
new file mode 100644
index 0000000..a7ccfe4
--- /dev/null
+++ b/tests/bfs/j1.out
@@ -0,0 +1,19 @@
+basic
+basic/a
+basic/b
+basic/c
+basic/c/d
+basic/e
+basic/e/f
+basic/g
+basic/g/h
+basic/i
+basic/j
+basic/j/foo
+basic/k
+basic/k/foo
+basic/k/foo/bar
+basic/l
+basic/l/foo
+basic/l/foo/bar
+basic/l/foo/bar/baz
diff --git a/tests/bfs/j1.sh b/tests/bfs/j1.sh
new file mode 100644
index 0000000..972ac1b
--- /dev/null
+++ b/tests/bfs/j1.sh
@@ -0,0 +1 @@
+bfs_diff -j1 basic
diff --git a/tests/bfs/j64.out b/tests/bfs/j64.out
new file mode 100644
index 0000000..a7ccfe4
--- /dev/null
+++ b/tests/bfs/j64.out
@@ -0,0 +1,19 @@
+basic
+basic/a
+basic/b
+basic/c
+basic/c/d
+basic/e
+basic/e/f
+basic/g
+basic/g/h
+basic/i
+basic/j
+basic/j/foo
+basic/k
+basic/k/foo
+basic/k/foo/bar
+basic/l
+basic/l/foo
+basic/l/foo/bar
+basic/l/foo/bar/baz
diff --git a/tests/bfs/j64.sh b/tests/bfs/j64.sh
new file mode 100644
index 0000000..c56788f
--- /dev/null
+++ b/tests/bfs/j64.sh
@@ -0,0 +1 @@
+bfs_diff -j64 basic
diff --git a/tests/bfs/j_negative.sh b/tests/bfs/j_negative.sh
new file mode 100644
index 0000000..809c98c
--- /dev/null
+++ b/tests/bfs/j_negative.sh
@@ -0,0 +1 @@
+! invoke_bfs -j-1 basic
diff --git a/tests/bfs/limit.out b/tests/bfs/limit.out
new file mode 100644
index 0000000..ea94276
--- /dev/null
+++ b/tests/bfs/limit.out
@@ -0,0 +1,4 @@
+basic/a
+basic/b
+basic/c/d
+basic/e/f
diff --git a/tests/bfs/limit.sh b/tests/bfs/limit.sh
new file mode 100644
index 0000000..84b605f
--- /dev/null
+++ b/tests/bfs/limit.sh
@@ -0,0 +1 @@
+bfs_diff -s basic -type f -print -limit 4
diff --git a/tests/bfs/limit_0.sh b/tests/bfs/limit_0.sh
new file mode 100644
index 0000000..3ce26de
--- /dev/null
+++ b/tests/bfs/limit_0.sh
@@ -0,0 +1 @@
+! invoke_bfs basic -print -limit 0
diff --git a/tests/bfs/limit_implicit_print.sh b/tests/bfs/limit_implicit_print.sh
new file mode 100644
index 0000000..cdb059d
--- /dev/null
+++ b/tests/bfs/limit_implicit_print.sh
@@ -0,0 +1 @@
+! invoke_bfs basic -type f -limit 1
diff --git a/tests/bfs/limit_incomplete.sh b/tests/bfs/limit_incomplete.sh
new file mode 100644
index 0000000..2d1e842
--- /dev/null
+++ b/tests/bfs/limit_incomplete.sh
@@ -0,0 +1 @@
+! invoke_bfs basic -print -limit
diff --git a/tests/bfs/limit_one.sh b/tests/bfs/limit_one.sh
new file mode 100644
index 0000000..3f8181c
--- /dev/null
+++ b/tests/bfs/limit_one.sh
@@ -0,0 +1 @@
+! invoke_bfs basic -print -limit one
diff --git a/tests/bfs/links_empty.sh b/tests/bfs/links_empty.sh
index 34c7c25..42cf6e5 100644
--- a/tests/bfs/links_empty.sh
+++ b/tests/bfs/links_empty.sh
@@ -1 +1 @@
-fail invoke_bfs links -links ''
+! invoke_bfs links -links ''
diff --git a/tests/bfs/links_invalid.sh b/tests/bfs/links_invalid.sh
index ff69fa6..4d139c9 100644
--- a/tests/bfs/links_invalid.sh
+++ b/tests/bfs/links_invalid.sh
@@ -1 +1 @@
-fail invoke_bfs links -links ASDF
+! invoke_bfs links -links ASDF
diff --git a/tests/bfs/links_leading_space.sh b/tests/bfs/links_leading_space.sh
new file mode 100644
index 0000000..15957af
--- /dev/null
+++ b/tests/bfs/links_leading_space.sh
@@ -0,0 +1 @@
+! invoke_bfs links -links ' 1'
diff --git a/tests/bfs/links_negative.sh b/tests/bfs/links_negative.sh
index b5d9c58..e664b99 100644
--- a/tests/bfs/links_negative.sh
+++ b/tests/bfs/links_negative.sh
@@ -1 +1 @@
-fail invoke_bfs links -links +-1
+! invoke_bfs links -links +-1
diff --git a/tests/bfs/links_noarg.sh b/tests/bfs/links_noarg.sh
index 5dede5f..5c948dc 100644
--- a/tests/bfs/links_noarg.sh
+++ b/tests/bfs/links_noarg.sh
@@ -1 +1 @@
-fail invoke_bfs links -links
+! invoke_bfs links -links
diff --git a/tests/bfs/newerma_nonexistent.sh b/tests/bfs/newerma_nonexistent.sh
index 7f3695f..cdedb4a 100644
--- a/tests/bfs/newerma_nonexistent.sh
+++ b/tests/bfs/newerma_nonexistent.sh
@@ -1 +1 @@
-fail invoke_bfs times -newerma basic/nonexistent
+! invoke_bfs times -newerma basic/nonexistent
diff --git a/tests/bfs/newermq.sh b/tests/bfs/newermq.sh
index 2a22586..2f705dc 100644
--- a/tests/bfs/newermq.sh
+++ b/tests/bfs/newermq.sh
@@ -1 +1 @@
-fail invoke_bfs times -newermq times/a
+! invoke_bfs times -newermq times/a
diff --git a/tests/bfs/newermt_invalid.sh b/tests/bfs/newermt_invalid.sh
index 61d2485..98efece 100644
--- a/tests/bfs/newermt_invalid.sh
+++ b/tests/bfs/newermt_invalid.sh
@@ -1 +1 @@
-fail invoke_bfs times -newermt not_a_date_time
+! invoke_bfs times -newermt not_a_date_time
diff --git a/tests/bfs/newerqm.sh b/tests/bfs/newerqm.sh
index da84350..c0cff98 100644
--- a/tests/bfs/newerqm.sh
+++ b/tests/bfs/newerqm.sh
@@ -1 +1 @@
-fail invoke_bfs times -newerqm times/a
+! invoke_bfs times -newerqm times/a
diff --git a/tests/bfs/nocolor.out b/tests/bfs/nocolor.out
index b53fe03..d51d24d 100644
--- a/tests/bfs/nocolor.out
+++ b/tests/bfs/nocolor.out
@@ -1,20 +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/star.gz
-rainbow/star.tar
-rainbow/star.tar.gz
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.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..d1c2afb
--- /dev/null
+++ b/tests/bfs/nocolor_env.sh
@@ -0,0 +1,3 @@
+NO_COLOR=1 bfs_pty rainbow >"$OUT"
+sort_output
+diff_output
diff --git a/tests/bfs/nocolor_env_empty.out b/tests/bfs/nocolor_env_empty.out
new file mode 100644
index 0000000..a439814
--- /dev/null
+++ b/tests/bfs/nocolor_env_empty.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/nocolor_env_empty.sh b/tests/bfs/nocolor_env_empty.sh
new file mode 100644
index 0000000..1edfb1d
--- /dev/null
+++ b/tests/bfs/nocolor_env_empty.sh
@@ -0,0 +1,3 @@
+NO_COLOR= bfs_pty rainbow >"$OUT"
+sort_output
+diff_output
diff --git a/tests/bfs/or_incomplete.sh b/tests/bfs/or_incomplete.sh
index c941b95..4af31b6 100644
--- a/tests/bfs/or_incomplete.sh
+++ b/tests/bfs/or_incomplete.sh
@@ -1 +1 @@
-fail invoke_bfs -print -o
+! invoke_bfs -print -o
diff --git a/tests/bfs/perm_symbolic_double_comma.sh b/tests/bfs/perm_symbolic_double_comma.sh
index 66db0ac..48f9d4b 100644
--- a/tests/bfs/perm_symbolic_double_comma.sh
+++ b/tests/bfs/perm_symbolic_double_comma.sh
@@ -1 +1 @@
-fail invoke_bfs perms -perm a+r,,u+w
+! invoke_bfs perms -perm a+r,,u+w
diff --git a/tests/bfs/perm_symbolic_missing_action.sh b/tests/bfs/perm_symbolic_missing_action.sh
index 3b18721..28446ab 100644
--- a/tests/bfs/perm_symbolic_missing_action.sh
+++ b/tests/bfs/perm_symbolic_missing_action.sh
@@ -1 +1 @@
-fail invoke_bfs perms -perm a
+! invoke_bfs perms -perm a
diff --git a/tests/bfs/perm_symbolic_trailing_comma.sh b/tests/bfs/perm_symbolic_trailing_comma.sh
index c52ebe6..01bbc16 100644
--- a/tests/bfs/perm_symbolic_trailing_comma.sh
+++ b/tests/bfs/perm_symbolic_trailing_comma.sh
@@ -1 +1 @@
-fail invoke_bfs perms -perm a+r,
+! invoke_bfs perms -perm a+r,
diff --git a/tests/bfs/printf_color.out b/tests/bfs/printf_color.out
index d9cd1a4..77d21c3 100644
--- a/tests/bfs/printf_color.out
+++ b/tests/bfs/printf_color.out
@@ -1,5 +1,8 @@
-. . rainbow ./rainbow rainbow
+. $'./rainbow/\e[1m' $'\e[0m' $'./rainbow/\e[1m/'$'\e[0m' $'rainbow/\e[1m/'$'\e[0m'
+. . . .
+. . rainbow ./rainbow rainbow
. ./rainbow exec.sh ./rainbow/exec.sh rainbow/exec.sh
+. ./rainbow $'\e[1m' $'./rainbow/\e[1m' $'rainbow/\e[1m'
. ./rainbow socket ./rainbow/socket rainbow/socket
. ./rainbow broken ./rainbow/broken rainbow/broken nowhere
. ./rainbow chardev_link ./rainbow/chardev_link rainbow/chardev_link /dev/null
@@ -13,8 +16,13 @@
. ./rainbow sticky ./rainbow/sticky rainbow/sticky
. ./rainbow file.dat ./rainbow/file.dat rainbow/file.dat
. ./rainbow file.txt ./rainbow/file.txt rainbow/file.txt
+. ./rainbow lower.gz ./rainbow/lower.gz rainbow/lower.gz
+. ./rainbow lower.tar ./rainbow/lower.tar rainbow/lower.tar
+. ./rainbow lower.tar.gz ./rainbow/lower.tar.gz rainbow/lower.tar.gz
+. ./rainbow lu.tar.GZ ./rainbow/lu.tar.GZ rainbow/lu.tar.GZ
. ./rainbow mh1 ./rainbow/mh1 rainbow/mh1
. ./rainbow mh2 ./rainbow/mh2 rainbow/mh2
-. ./rainbow star.gz ./rainbow/star.gz rainbow/star.gz
-. ./rainbow star.tar ./rainbow/star.tar rainbow/star.tar
-. ./rainbow star.tar.gz ./rainbow/star.tar.gz rainbow/star.tar.gz
+. ./rainbow ul.TAR.gz ./rainbow/ul.TAR.gz rainbow/ul.TAR.gz
+. ./rainbow upper.GZ ./rainbow/upper.GZ rainbow/upper.GZ
+. ./rainbow upper.TAR ./rainbow/upper.TAR rainbow/upper.TAR
+. ./rainbow upper.TAR.GZ ./rainbow/upper.TAR.GZ rainbow/upper.TAR.GZ
diff --git a/tests/bfs/printf_color.sh b/tests/bfs/printf_color.sh
index 7bb38c2..3641ddb 100644
--- a/tests/bfs/printf_color.sh
+++ b/tests/bfs/printf_color.sh
@@ -1 +1 @@
-bfs_diff -color -path './rainbow*' -printf '%H %h %f %p %P %l\n'
+bfs_diff -color -exclude \( -depth 1 -not -name rainbow \) -printf '%H %h %f %p %P %l\n'
diff --git a/tests/bfs/printf_duplicate_flag.sh b/tests/bfs/printf_duplicate_flag.sh
index 77650d0..5ff29f1 100644
--- a/tests/bfs/printf_duplicate_flag.sh
+++ b/tests/bfs/printf_duplicate_flag.sh
@@ -1 +1 @@
-fail invoke_bfs basic -printf '%--p'
+! invoke_bfs basic -printf '%--p'
diff --git a/tests/bfs/printf_everything.sh b/tests/bfs/printf_everything.sh
index 5f20718..07d574a 100644
--- a/tests/bfs/printf_everything.sh
+++ b/tests/bfs/printf_everything.sh
@@ -1,14 +1,14 @@
everything=(%{a,b,c,d,D,f,g,G,h,H,i,k,l,m,M,n,p,P,s,S,t,u,U,y,Y})
# Check if we have fstypes
-if ! fail invoke_bfs basic -printf '%F' -quit >/dev/null; then
+if invoke_bfs basic -printf '%F' -quit >/dev/null; then
everything+=(%F)
fi
everything+=(%{A,C,T}{%,+,@,a,A,b,B,c,C,d,D,e,F,g,G,h,H,I,j,k,l,m,M,n,p,r,R,s,S,t,T,u,U,V,w,W,x,X,y,Y,z,Z})
# Check if we have birth times
-if ! fail invoke_bfs basic -printf '%w' -quit >/dev/null; then
+if invoke_bfs basic -printf '%w' -quit >/dev/null; then
everything+=(%w %{B,W}{%,+,@,a,A,b,B,c,C,d,D,e,F,g,G,h,H,I,j,k,l,m,M,n,p,r,R,s,S,t,T,u,U,V,w,W,x,X,y,Y,z,Z})
fi
diff --git a/tests/bfs/printf_incomplete_escape.sh b/tests/bfs/printf_incomplete_escape.sh
index 144add5..f560d28 100644
--- a/tests/bfs/printf_incomplete_escape.sh
+++ b/tests/bfs/printf_incomplete_escape.sh
@@ -1 +1 @@
-fail invoke_bfs basic -printf '\'
+! invoke_bfs basic -printf '\'
diff --git a/tests/bfs/printf_incomplete_format.sh b/tests/bfs/printf_incomplete_format.sh
index 347a0f4..92c6afc 100644
--- a/tests/bfs/printf_incomplete_format.sh
+++ b/tests/bfs/printf_incomplete_format.sh
@@ -1 +1 @@
-fail invoke_bfs basic -printf '%'
+! invoke_bfs basic -printf '%'
diff --git a/tests/bfs/printf_invalid_escape.sh b/tests/bfs/printf_invalid_escape.sh
index ce12233..4338f9b 100644
--- a/tests/bfs/printf_invalid_escape.sh
+++ b/tests/bfs/printf_invalid_escape.sh
@@ -1 +1 @@
-fail invoke_bfs basic -printf '\!'
+! invoke_bfs basic -printf '\!'
diff --git a/tests/bfs/printf_invalid_format.sh b/tests/bfs/printf_invalid_format.sh
index 1717615..59d63a7 100644
--- a/tests/bfs/printf_invalid_format.sh
+++ b/tests/bfs/printf_invalid_format.sh
@@ -1 +1 @@
-fail invoke_bfs basic -printf '%!'
+! invoke_bfs basic -printf '%!'
diff --git a/tests/bfs/printf_must_be_numeric.sh b/tests/bfs/printf_must_be_numeric.sh
index eabb3d6..7c7c3fa 100644
--- a/tests/bfs/printf_must_be_numeric.sh
+++ b/tests/bfs/printf_must_be_numeric.sh
@@ -1 +1 @@
-fail invoke_bfs basic -printf '%+p'
+! invoke_bfs basic -printf '%+p'
diff --git a/tests/bfs/status.sh b/tests/bfs/status.sh
new file mode 100644
index 0000000..83e12d3
--- /dev/null
+++ b/tests/bfs/status.sh
@@ -0,0 +1 @@
+bfs_pty basic -status -print -depth 0 -exec stty cols 123 rows 14 \; >"$OUT"
diff --git a/tests/bfs/stderr_fails_loudly.sh b/tests/bfs/stderr_fails_loudly.sh
index d8b3861..8572d5a 100644
--- a/tests/bfs/stderr_fails_loudly.sh
+++ b/tests/bfs/stderr_fails_loudly.sh
@@ -1,2 +1,2 @@
-skip_unless test -e /dev/full
-fail invoke_bfs -D all basic -false -fprint /dev/full 2>/dev/full
+test -e /dev/full || skip
+! invoke_bfs -D all basic -false -fprint /dev/full 2>/dev/full
diff --git a/tests/bfs/stderr_fails_silently.sh b/tests/bfs/stderr_fails_silently.sh
index 731cb02..a37393d 100644
--- a/tests/bfs/stderr_fails_silently.sh
+++ b/tests/bfs/stderr_fails_silently.sh
@@ -1,2 +1,2 @@
-skip_unless test -e /dev/full
+test -e /dev/full || skip
bfs_diff -D all basic 2>/dev/full
diff --git a/tests/bfs/unexpected_operator.sh b/tests/bfs/unexpected_operator.sh
index b3658f6..2eb0e71 100644
--- a/tests/bfs/unexpected_operator.sh
+++ b/tests/bfs/unexpected_operator.sh
@@ -1 +1 @@
-fail invoke_bfs \! -o -print
+! invoke_bfs \! -o -print
diff --git a/tests/bfs/warn_O9.out b/tests/bfs/warn_O9.out
new file mode 100644
index 0000000..336a6e8
--- /dev/null
+++ b/tests/bfs/warn_O9.out
@@ -0,0 +1,19 @@
+.
+./a
+./b
+./c
+./c/d
+./e
+./e/f
+./g
+./g/h
+./i
+./j
+./j/foo
+./k
+./k/foo
+./k/foo/bar
+./l
+./l/foo
+./l/foo/bar
+./l/foo/bar/baz
diff --git a/tests/bfs/warn_O9.sh b/tests/bfs/warn_O9.sh
new file mode 100644
index 0000000..821789f
--- /dev/null
+++ b/tests/bfs/warn_O9.sh
@@ -0,0 +1,3 @@
+# Regression test: don't crash when warning if -O9 is the last argument
+cd basic
+bfs_diff -warn -O9
diff --git a/tests/bfs/warn_xdev_mount.out b/tests/bfs/warn_xdev_mount.out
new file mode 100644
index 0000000..a7ccfe4
--- /dev/null
+++ b/tests/bfs/warn_xdev_mount.out
@@ -0,0 +1,19 @@
+basic
+basic/a
+basic/b
+basic/c
+basic/c/d
+basic/e
+basic/e/f
+basic/g
+basic/g/h
+basic/i
+basic/j
+basic/j/foo
+basic/k
+basic/k/foo
+basic/k/foo/bar
+basic/l
+basic/l/foo
+basic/l/foo/bar
+basic/l/foo/bar/baz
diff --git a/tests/bfs/warn_xdev_mount.sh b/tests/bfs/warn_xdev_mount.sh
new file mode 100644
index 0000000..5d395f6
--- /dev/null
+++ b/tests/bfs/warn_xdev_mount.sh
@@ -0,0 +1,2 @@
+# Regression test: don't crash if -mount is the last option
+bfs_diff basic -warn -xdev -mount
diff --git a/tests/bfs/xtype_depth.sh b/tests/bfs/xtype_depth.sh
index cd478af..02c8173 100644
--- a/tests/bfs/xtype_depth.sh
+++ b/tests/bfs/xtype_depth.sh
@@ -1,2 +1,2 @@
# Make sure -xtype is considered side-effecting for facts_when_impure
-fail invoke_bfs loops -xtype l -depth 100
+! invoke_bfs loops -xtype l -depth 100