summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-02-09 20:02:52 -0500
committerTavian Barnes <tavianator@tavianator.com>2017-02-09 20:02:52 -0500
commit65af85882ae46cd8750b7f03519c3b291fc693db (patch)
tree6b09d9358af947bbef179de2fd95d5d3b2be4dfd
parent49415accb857450cdeb4397c31cbe4d6e6e9591f (diff)
downloadbfs-65af85882ae46cd8750b7f03519c3b291fc693db.tar.xz
Give the test cases human-readable names
-rwxr-xr-xtests.sh745
-rw-r--r--tests/test_E.out (renamed from tests/test_0103.out)0
-rw-r--r--tests/test_H.out (renamed from tests/test_0027.out)0
-rw-r--r--tests/test_H_broken.out (renamed from tests/test_0032.out)0
-rw-r--r--tests/test_H_mnewer.out (renamed from tests/test_0022.out)0
-rw-r--r--tests/test_H_newer.out (renamed from tests/test_0023.out)0
-rw-r--r--tests/test_H_slash.out (renamed from tests/test_0028.out)0
-rw-r--r--tests/test_L.out (renamed from tests/test_0033.out)0
-rw-r--r--tests/test_L_depth.out (renamed from tests/test_0034.out)0
-rw-r--r--tests/test_L_ilname.out (renamed from tests/test_0049.out)0
-rw-r--r--tests/test_L_lname.out (renamed from tests/test_0050.out)0
-rw-r--r--tests/test_L_xtype_f.out (renamed from tests/test_0024.out)0
-rw-r--r--tests/test_L_xtype_l.out (renamed from tests/test_0039.out)0
-rw-r--r--tests/test_P.out (renamed from tests/test_0029.out)0
-rw-r--r--tests/test_P_slash.out (renamed from tests/test_0030.out)0
-rw-r--r--tests/test_anewer.out (renamed from tests/test_0031.out)0
-rw-r--r--tests/test_basic.out (renamed from tests/test_0001.out)0
-rw-r--r--tests/test_comma.out (renamed from tests/test_0068.out)0
-rw-r--r--tests/test_d_path.out (renamed from tests/test_0016.out)0
-rw-r--r--tests/test_daystart.out (renamed from tests/test_0017.out)0
-rw-r--r--tests/test_daystart_twice.out (renamed from tests/test_0018.out)0
-rw-r--r--tests/test_depth.out (renamed from tests/test_0019.out)0
-rw-r--r--tests/test_depth_depth_n.out (renamed from tests/test_0112.out)0
-rw-r--r--tests/test_depth_depth_n_minus.out (renamed from tests/test_0005.out)0
-rw-r--r--tests/test_depth_depth_n_plus.out (renamed from tests/test_0113.out)0
-rw-r--r--tests/test_depth_maxdepth_1.out (renamed from tests/test_0008.out)0
-rw-r--r--tests/test_depth_maxdepth_2.out (renamed from tests/test_0009.out)0
-rw-r--r--tests/test_depth_mindepth_1.out (renamed from tests/test_0004.out)0
-rw-r--r--tests/test_depth_mindepth_2.out (renamed from tests/test_0007.out)0
-rw-r--r--tests/test_depth_n.out (renamed from tests/test_0115.out)0
-rw-r--r--tests/test_depth_n_minus.out (renamed from tests/test_0114.out)0
-rw-r--r--tests/test_depth_n_plus.out (renamed from tests/test_0116.out)0
-rw-r--r--tests/test_depth_slash.out (renamed from tests/test_0096.out)0
-rw-r--r--tests/test_double_dash.out (renamed from tests/test_0074.out)0
-rw-r--r--tests/test_empty.out (renamed from tests/test_0015.out)0
-rw-r--r--tests/test_exec.out (renamed from tests/test_0020.out)0
-rw-r--r--tests/test_exec_substring.out (renamed from tests/test_0063.out)0
-rw-r--r--tests/test_execdir.out (renamed from tests/test_0065.out)0
-rw-r--r--tests/test_execdir_pwd.out (renamed from tests/test_0064.out)0
-rw-r--r--tests/test_execdir_slash.out (renamed from tests/test_0043.out)0
-rw-r--r--tests/test_execdir_slash_pwd.out (renamed from tests/test_0098.out)0
-rw-r--r--tests/test_execdir_slashes.out (renamed from tests/test_0044.out)0
-rw-r--r--tests/test_execdir_substring.out (renamed from tests/test_0066.out)0
-rw-r--r--tests/test_executable.out (renamed from tests/test_0012.out)0
-rw-r--r--tests/test_f.out (renamed from tests/test_0109.out)0
-rw-r--r--tests/test_flag_comma.out (renamed from tests/test_0071.out)0
-rw-r--r--tests/test_flag_double_dash.out (renamed from tests/test_0075.out)0
-rw-r--r--tests/test_flag_weird_names.out (renamed from tests/test_0069.out)0
-rw-r--r--tests/test_follow.out (renamed from tests/test_0035.out)0
-rw-r--r--tests/test_follow_comma.out (renamed from tests/test_0072.out)0
-rw-r--r--tests/test_fprint.out (renamed from tests/test_0073.out)0
-rw-r--r--tests/test_gid.out (renamed from tests/test_0021.out)0
-rw-r--r--tests/test_gid_minus.out (renamed from tests/test_0051.out)0
-rw-r--r--tests/test_gid_name.out (renamed from tests/test_0052.out)0
-rw-r--r--tests/test_gid_plus.out (renamed from tests/test_0053.out)0
-rw-r--r--tests/test_group_id.out (renamed from tests/test_0054.out)0
-rw-r--r--tests/test_group_name.out (renamed from tests/test_0055.out)0
-rw-r--r--tests/test_hidden.out (renamed from tests/test_0110.out)0
-rw-r--r--tests/test_ilname.out (renamed from tests/test_0047.out)0
-rw-r--r--tests/test_iname.out (renamed from tests/test_0010.out)0
-rw-r--r--tests/test_inum.out (renamed from tests/test_0127.out)0
-rw-r--r--tests/test_ipath.out (renamed from tests/test_0011.out)0
-rw-r--r--tests/test_iregex.out (renamed from tests/test_0101.out)0
-rw-r--r--tests/test_links.out (renamed from tests/test_0026.out)0
-rw-r--r--tests/test_links_minus.out (renamed from tests/test_0025.out)0
-rw-r--r--tests/test_links_plus.out (renamed from tests/test_0036.out)0
-rw-r--r--tests/test_lname.out (renamed from tests/test_0048.out)0
-rw-r--r--tests/test_maxdepth.out (renamed from tests/test_0117.out)0
-rw-r--r--tests/test_mindepth.out (renamed from tests/test_0006.out)0
-rw-r--r--tests/test_mnewer.out (renamed from tests/test_0057.out)0
-rw-r--r--tests/test_name.out (renamed from tests/test_0045.out)0
-rw-r--r--tests/test_name_root.out (renamed from tests/test_0041.out)0
-rw-r--r--tests/test_name_root_depth.out (renamed from tests/test_0123.out)0
-rw-r--r--tests/test_name_slash.out (renamed from tests/test_0099.out)0
-rw-r--r--tests/test_name_slashes.out (renamed from tests/test_0100.out)0
-rw-r--r--tests/test_name_trailing_slash.out (renamed from tests/test_0042.out)0
-rw-r--r--tests/test_newer.out (renamed from tests/test_0120.out)0
-rw-r--r--tests/test_newerma.out (renamed from tests/test_0121.out)0
-rw-r--r--tests/test_nogroup.out (renamed from tests/test_0061.out)0
-rw-r--r--tests/test_nohidden.out (renamed from tests/test_0111.out)0
-rw-r--r--tests/test_nouser.out (renamed from tests/test_0084.out)0
-rw-r--r--tests/test_ok_stdin.out (renamed from tests/test_0094.out)0
-rw-r--r--tests/test_okdir_stdin.out (renamed from tests/test_0095.out)0
-rw-r--r--tests/test_parens.out (renamed from tests/test_0067.out)0
-rw-r--r--tests/test_path.out (renamed from tests/test_0046.out)0
-rw-r--r--tests/test_path_d.out (renamed from tests/test_0056.out)0
-rw-r--r--tests/test_perm_222.out (renamed from tests/test_0078.out)0
-rw-r--r--tests/test_perm_222_minus.out (renamed from tests/test_0079.out)0
-rw-r--r--tests/test_perm_222_slash.out (renamed from tests/test_0014.out)0
-rw-r--r--tests/test_perm_644.out (renamed from tests/test_0081.out)0
-rw-r--r--tests/test_perm_644_minus.out (renamed from tests/test_0082.out)0
-rw-r--r--tests/test_perm_644_slash.out (renamed from tests/test_0083.out)0
-rw-r--r--tests/test_perm_leading_plus_symbolic.out (renamed from tests/test_0090.out)0
-rw-r--r--tests/test_perm_leading_plus_symbolic_minus.out (renamed from tests/test_0092.out)0
-rw-r--r--tests/test_perm_leading_plus_symbolic_slash.out (renamed from tests/test_0086.out)0
-rw-r--r--tests/test_perm_symbolic.out (renamed from tests/test_0128.out)0
-rw-r--r--tests/test_perm_symbolic_minus.out (renamed from tests/test_0085.out)0
-rw-r--r--tests/test_perm_symbolic_slash.out (renamed from tests/test_0091.out)0
-rw-r--r--tests/test_printf.out (renamed from tests/test_0130.out)0
-rw-r--r--tests/test_printf_escapes.out (renamed from tests/test_0137.out)0
-rw-r--r--tests/test_printf_flags.out (renamed from tests/test_0135.out)0
-rw-r--r--tests/test_printf_leak.out (renamed from tests/test_0139.out)0
-rw-r--r--tests/test_printf_slash.out (renamed from tests/test_0131.out)0
-rw-r--r--tests/test_printf_slashes.out (renamed from tests/test_0132.out)0
-rw-r--r--tests/test_printf_trailing_slash.out (renamed from tests/test_0133.out)0
-rw-r--r--tests/test_printf_trailing_slashes.out (renamed from tests/test_0134.out)0
-rw-r--r--tests/test_printf_types.out (renamed from tests/test_0136.out)0
-rw-r--r--tests/test_quit.out (renamed from tests/test_0138.out)0
-rw-r--r--tests/test_quit_after_print.out (renamed from tests/test_0141.out)0
-rw-r--r--tests/test_quit_before_print.out (renamed from tests/test_0129.out)0
-rw-r--r--tests/test_quit_child.out (renamed from tests/test_0124.out)0
-rw-r--r--tests/test_quit_depth.out (renamed from tests/test_0125.out)0
-rw-r--r--tests/test_quit_depth_child.out (renamed from tests/test_0126.out)0
-rw-r--r--tests/test_readable.out (renamed from tests/test_0013.out)0
-rw-r--r--tests/test_regex.out (renamed from tests/test_0102.out)0
-rw-r--r--tests/test_regex_parens.out (renamed from tests/test_0104.out)0
-rw-r--r--tests/test_regextype_posix_basic.out (renamed from tests/test_0105.out)0
-rw-r--r--tests/test_regextype_posix_extended.out (renamed from tests/test_0106.out)0
-rw-r--r--tests/test_samefile.out (renamed from tests/test_0040.out)0
-rw-r--r--tests/test_size.out (renamed from tests/test_0058.out)0
-rw-r--r--tests/test_size_T.out (renamed from tests/test_0059.out)0
-rw-r--r--tests/test_size_big.out (renamed from tests/test_0140.out)0
-rw-r--r--tests/test_size_bytes.out (renamed from tests/test_0060.out)0
-rw-r--r--tests/test_size_plus.out (renamed from tests/test_0122.out)0
-rw-r--r--tests/test_type_d.out (renamed from tests/test_0002.out)0
-rw-r--r--tests/test_type_f.out (renamed from tests/test_0003.out)0
-rw-r--r--tests/test_type_multi.out (renamed from tests/test_0142.out)0
-rw-r--r--tests/test_uid.out (renamed from tests/test_0062.out)0
-rw-r--r--tests/test_uid_minus.out (renamed from tests/test_0107.out)0
-rw-r--r--tests/test_uid_name.out (renamed from tests/test_0108.out)0
-rw-r--r--tests/test_uid_plus.out (renamed from tests/test_0118.out)0
-rw-r--r--tests/test_user_id.out (renamed from tests/test_0119.out)0
-rw-r--r--tests/test_user_name.out19
-rw-r--r--tests/test_weird_names.out (renamed from tests/test_0070.out)0
-rw-r--r--tests/test_writable.out (renamed from tests/test_0080.out)0
-rw-r--r--tests/test_xtype_f.out (renamed from tests/test_0038.out)0
-rw-r--r--tests/test_xtype_l.out (renamed from tests/test_0037.out)0
-rw-r--r--tests/test_xtype_multi.out (renamed from tests/test_0143.out)0
138 files changed, 452 insertions, 312 deletions
diff --git a/tests.sh b/tests.sh
index 084e8ac..bf5aab8 100755
--- a/tests.sh
+++ b/tests.sh
@@ -106,6 +106,196 @@ function _realpath() {
BFS="$(_realpath ./bfs)"
TESTS="$(_realpath ./tests)"
+posix_tests=(
+ test_basic
+ test_type_d
+ test_type_f
+ test_mindepth
+ test_maxdepth
+ test_depth
+ test_depth_slash
+ test_depth_mindepth_1
+ test_depth_mindepth_2
+ test_depth_maxdepth_1
+ test_depth_maxdepth_2
+ test_name
+ test_name_root
+ test_name_root_depth
+ test_name_trailing_slash
+ test_path
+ test_newer
+ test_links
+ test_links_plus
+ test_links_minus
+ test_H
+ test_H_slash
+ test_H_broken
+ test_H_newer
+ test_L
+ test_L_depth
+ test_user_name
+ test_user_id
+ test_group_name
+ test_group_id
+ test_size
+ test_size_plus
+ test_size_bytes
+ test_exec
+ test_parens
+ test_flag_comma
+ test_perm_222
+ test_perm_222_minus
+ test_perm_644
+ test_perm_644_minus
+ test_perm_symbolic
+ test_perm_symbolic_minus
+ test_perm_leading_plus_symbolic_minus
+ test_ok_stdin
+)
+
+bsd_tests=(
+ test_P
+ test_P_slash
+ test_follow
+ test_samefile
+ test_name_slash
+ test_name_slashes
+ test_iname
+ test_ipath
+ test_lname
+ test_ilname
+ test_L_lname
+ test_L_ilname
+ test_newerma
+ test_size_big
+ test_exec_substring
+ test_execdir_pwd
+ test_double_dash
+ test_flag_double_dash
+ test_ok_stdin
+ test_okdir_stdin
+ test_delete_root
+ test_execdir_slash
+ test_execdir_slash_pwd
+ test_regex
+ test_iregex
+ test_regex_parens
+ test_E
+ test_d_path
+ test_f
+ test_depth_n
+ test_depth_n_plus
+ test_depth_n_minus
+ test_depth_depth_n
+ test_depth_depth_n_plus
+ test_depth_depth_n_minus
+ test_gid_name
+ test_uid_name
+ test_mnewer
+ test_H_mnewer
+ test_size_T
+ test_quit
+ test_quit_child
+ test_quit_depth
+ test_quit_depth_child
+ test_inum
+ test_nogroup
+ test_nouser
+ test_quit_after_print
+ test_quit_before_print
+)
+
+gnu_tests=(
+ test_executable
+ test_readable
+ test_writable
+ test_empty
+ test_gid
+ test_gid_plus
+ test_gid_minus
+ test_uid
+ test_uid_plus
+ test_uid_minus
+ test_anewer
+ test_P
+ test_P_slash
+ test_follow
+ test_samefile
+ test_xtype_l
+ test_xtype_f
+ test_L_xtype_l
+ test_L_xtype_f
+ test_name_slash
+ test_name_slashes
+ test_iname
+ test_ipath
+ test_lname
+ test_ilname
+ test_L_lname
+ test_L_ilname
+ test_daystart
+ test_daystart_twice
+ test_newerma
+ test_size_big
+ test_exec_substring
+ test_execdir
+ test_execdir_substring
+ test_execdir_pwd
+ test_comma
+ test_weird_names
+ test_flag_weird_names
+ test_follow_comma
+ test_fprint
+ test_double_dash
+ test_flag_double_dash
+ test_ignore_readdir_race
+ test_ignore_readdir_race_root
+ test_perm_222_slash
+ test_perm_644_slash
+ test_perm_symbolic_slash
+ test_perm_leading_plus_symbolic_slash
+ test_delete_root
+ test_execdir_slash
+ test_execdir_slash_pwd
+ test_regex
+ test_iregex
+ test_regex_parens
+ test_regextype_posix_basic
+ test_regextype_posix_extended
+ test_path_d
+ test_quit
+ test_quit_child
+ test_quit_depth
+ test_quit_depth_child
+ test_inum
+ test_nogroup
+ test_nouser
+ test_printf
+ test_printf_slash
+ test_printf_slashes
+ test_printf_trailing_slash
+ test_printf_trailing_slashes
+ test_printf_flags
+ test_printf_types
+ test_printf_escapes
+ test_quit_after_print
+ test_quit_before_print
+ test_printf_leak
+)
+
+bfs_tests=(
+ test_type_multi
+ test_xtype_multi
+ test_perm_symbolic_trailing_comma
+ test_perm_symbolic_double_comma
+ test_perm_symbolic_missing_action
+ test_perm_leading_plus_symbolic
+ test_perm_octal_plus
+ test_execdir_slashes
+ test_hidden
+ test_nohidden
+)
+
BSD=yes
GNU=yes
ALL=yes
@@ -145,6 +335,30 @@ for arg; do
esac
done
+declare -A run_tests
+
+for test in "${posix_tests[@]}"; do
+ run_tests["$test"]=yes
+done
+
+if [ "$BSD" ]; then
+ for test in "${bsd_tests[@]}"; do
+ run_tests["$test"]=yes
+ done
+fi
+
+if [ "$GNU" ]; then
+ for test in "${gnu_tests[@]}"; do
+ run_tests["$test"]=yes
+ done
+fi
+
+if [ "$ALL" ]; then
+ for test in "${bfs_tests[@]}"; do
+ run_tests["$test"]=yes
+ done
+fi
+
function bfs_sort() {
awk -F/ '{ print NF - 1 " " $0 }' | sort -n | cut -d' ' -f2-
}
@@ -162,372 +376,344 @@ cd "$TMP"
# Test cases
-function test_0001() {
+function test_basic() {
bfs_diff basic
}
-function test_0002() {
+function test_type_d() {
bfs_diff basic -type d
}
-function test_0003() {
+function test_type_f() {
bfs_diff basic -type f
}
-function test_0004() {
+function test_type_multi() {
+ bfs_diff links -type f,d,c
+}
+
+function test_mindepth() {
bfs_diff basic -mindepth 1
}
-function test_0005() {
+function test_maxdepth() {
bfs_diff basic -maxdepth 1
}
-function test_0006() {
+function test_depth() {
+ bfs_diff basic -depth
+}
+
+function test_depth_slash() {
+ bfs_diff basic/ -depth
+}
+
+function test_depth_mindepth_1() {
bfs_diff basic -mindepth 1 -depth
}
-function test_0007() {
+function test_depth_mindepth_2() {
bfs_diff basic -mindepth 2 -depth
}
-function test_0008() {
+function test_depth_maxdepth_1() {
bfs_diff basic -maxdepth 1 -depth
}
-function test_0009() {
+function test_depth_maxdepth_2() {
bfs_diff basic -maxdepth 2 -depth
}
-function test_0010() {
+function test_name() {
bfs_diff basic -name '*f*'
}
-function test_0011() {
+function test_name_root() {
+ bfs_diff basic/a -name a
+}
+
+function test_name_root_depth() {
+ bfs_diff basic/g -depth -name g
+}
+
+function test_name_trailing_slash() {
+ bfs_diff basic/g/ -name g
+}
+
+function test_name_slash() {
+ bfs_diff / -maxdepth 0 -name / 2>/dev/null
+}
+
+function test_name_slashes() {
+ bfs_diff /// -maxdepth 0 -name / 2>/dev/null
+}
+
+function test_path() {
bfs_diff basic -path 'basic/*f*'
}
-function test_0012() {
- [ "$GNU" ] || return 0
+function test_executable() {
bfs_diff perms -executable
}
-function test_0013() {
- [ "$GNU" ] || return 0
+function test_readable() {
bfs_diff perms -readable
}
-function test_0014() {
- [ "$GNU" ] || return 0
+function test_writable() {
bfs_diff perms -writable
}
-function test_0015() {
- [ "$GNU" ] || return 0
+function test_empty() {
bfs_diff basic -empty
}
-function test_0016() {
- [ "$GNU" ] || return 0
+function test_gid() {
bfs_diff basic -gid "$(id -g)"
}
-function test_0017() {
- [ "$GNU" ] || return 0
+function test_gid_plus() {
bfs_diff basic -gid +0
}
-function test_0018() {
- [ "$GNU" ] || return 0
+function test_gid_minus() {
bfs_diff basic -gid "-$(($(id -g) + 1))"
}
-function test_0019() {
- [ "$GNU" ] || return 0
+function test_uid() {
bfs_diff basic -uid "$(id -u)"
}
-function test_0020() {
- [ "$GNU" ] || return 0
+function test_uid_plus() {
bfs_diff basic -uid +0
}
-function test_0021() {
- [ "$GNU" ] || return 0
+function test_uid_minus() {
bfs_diff basic -uid "-$(($(id -u) + 1))"
}
-function test_0022() {
+function test_newer() {
bfs_diff times -newer times/a
}
-function test_0023() {
- [ "$GNU" ] || return 0
+function test_anewer() {
bfs_diff times -anewer times/a
}
-function test_0024() {
+function test_links() {
bfs_diff links -type f -links 2
}
-function test_0025() {
- bfs_diff links -type f -links -2
+function test_links_plus() {
+ bfs_diff links -type f -links +1
}
-function test_0026() {
- bfs_diff links -type f -links +1
+function test_links_minus() {
+ bfs_diff links -type f -links -2
}
-function test_0027() {
+function test_P() {
bfs_diff -P links/d/e/f
}
-function test_0028() {
+function test_P_slash() {
bfs_diff -P links/d/e/f/
}
-function test_0029() {
+function test_H() {
bfs_diff -H links/d/e/f
}
-function test_0030() {
+function test_H_slash() {
bfs_diff -H links/d/e/f/
}
-function test_0031() {
- bfs_diff -H times -newer times/l
+function test_H_broken() {
+ bfs_diff -H links/d/e/i
}
-function test_0032() {
- bfs_diff -H links/d/e/i
+function test_H_newer() {
+ bfs_diff -H times -newer times/l
}
-function test_0033() {
+function test_L() {
bfs_diff -L links 2>/dev/null
}
-function test_0034() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_follow() {
bfs_diff links -follow 2>/dev/null
}
-function test_0035() {
+function test_L_depth() {
bfs_diff -L links -depth 2>/dev/null
}
-function test_0036() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_samefile() {
bfs_diff links -samefile links/a
}
-function test_0037() {
- [ "$GNU" ] || return 0
+function test_xtype_l() {
bfs_diff links -xtype l
}
-function test_0038() {
- [ "$GNU" ] || return 0
+function test_xtype_f() {
bfs_diff links -xtype f
}
-function test_0039() {
- [ "$GNU" ] || return 0
+function test_L_xtype_l() {
bfs_diff -L links -xtype l 2>/dev/null
}
-function test_0040() {
- [ "$GNU" ] || return 0
+function test_L_xtype_f() {
bfs_diff -L links -xtype f 2>/dev/null
}
-function test_0041() {
- bfs_diff basic/a -name a
-}
-
-function test_0042() {
- bfs_diff basic/g/ -name g
-}
-
-function test_0043() {
- [ "$BSD" -o "$GNU" ] || return 0
- bfs_diff / -maxdepth 0 -name / 2>/dev/null
-}
-
-function test_0044() {
- [ "$BSD" -o "$GNU" ] || return 0
- bfs_diff /// -maxdepth 0 -name / 2>/dev/null
+function test_xtype_multi() {
+ bfs_diff links -xtype f,d,c
}
-function test_0045() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_iname() {
bfs_diff basic -iname '*F*'
}
-function test_0046() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_ipath() {
bfs_diff basic -ipath 'basic/*F*'
}
-function test_0047() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_lname() {
bfs_diff links -lname '[aq]'
}
-function test_0048() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_ilname() {
bfs_diff links -ilname '[AQ]'
}
-function test_0049() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_L_lname() {
bfs_diff -L links -lname '[aq]' 2>/dev/null
}
-function test_0050() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_L_ilname() {
bfs_diff -L links -ilname '[AQ]' 2>/dev/null
}
-function test_0051() {
- bfs_diff -L basic -user "$(id -un)"
+function test_user_name() {
+ bfs_diff basic -user "$(id -un)"
}
-function test_0052() {
- bfs_diff -L basic -user "$(id -u)"
+function test_user_id() {
+ bfs_diff basic -user "$(id -u)"
}
-function test_0053() {
- bfs_diff -L basic -group "$(id -gn)"
+function test_group_name() {
+ bfs_diff basic -group "$(id -gn)"
}
-function test_0054() {
- bfs_diff -L basic -group "$(id -g)"
+function test_group_id() {
+ bfs_diff basic -group "$(id -g)"
}
-function test_0055() {
- [ "$GNU" ] || return 0
+function test_daystart() {
bfs_diff basic -daystart -mtime 0
}
-function test_0056() {
- [ "$GNU" ] || return 0
+function test_daystart_twice() {
bfs_diff basic -daystart -daystart -mtime 0
}
-function test_0057() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_newerma() {
bfs_diff times -newerma times/a
}
-function test_0058() {
+function test_size() {
bfs_diff basic -type f -size 0
}
-function test_0059() {
+function test_size_plus() {
bfs_diff basic -type f -size +0
}
-function test_0060() {
+function test_size_bytes() {
bfs_diff basic -type f -size +0c
}
-function test_0061() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_size_big() {
bfs_diff basic -size 9223372036854775807
}
-function test_0062() {
+function test_exec() {
bfs_diff basic -exec echo '{}' ';'
}
-function test_0063() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_exec_substring() {
bfs_diff basic -exec echo '-{}-' ';'
}
-function test_0064() {
- [ "$BSD" -o "$GNU" ] || return 0
-
- local TMP_REAL="$(cd "$TMP" && pwd)"
- local OFFSET="$((${#TMP_REAL} + 2))"
- bfs_diff basic -execdir bash -c "pwd | cut -b$OFFSET-" ';'
-}
-
-function test_0065() {
- [ "$GNU" ] || return 0
+function test_execdir() {
bfs_diff basic -execdir echo '{}' ';'
}
-function test_0066() {
- [ "$GNU" ] || return 0
+function test_execdir_substring() {
bfs_diff basic -execdir echo '-{}-' ';'
}
-function test_0067() {
+function test_execdir_pwd() {
+ local TMP_REAL="$(cd "$TMP" && pwd)"
+ local OFFSET="$((${#TMP_REAL} + 2))"
+ bfs_diff basic -execdir bash -c "pwd | cut -b$OFFSET-" ';'
+}
+
+function test_parens() {
bfs_diff basic \( -name '*f*' \)
}
-function test_0068() {
- [ "$GNU" ] || return 0
+function test_comma() {
bfs_diff basic -name '*f*' -print , -print
}
-function test_0069() {
- [ "$GNU" ] || return 0
+function test_weird_names() {
cd weirdnames
bfs_diff '-' '(-' '!-' ',' ')' './(' './!' \( \! -print , -print \)
}
-function test_0070() {
- [ "$GNU" ] || return 0
+function test_flag_weird_names() {
cd weirdnames
bfs_diff -L '-' '(-' '!-' ',' ')' './(' './!' \( \! -print , -print \)
}
-function test_0071() {
+function test_flag_comma() {
+ # , is a filename until a non-flag is seen
cd weirdnames
bfs_diff -L ',' -print
}
-function test_0072() {
- [ "$GNU" ] || return 0
+function test_follow_comma() {
+ # , is an operator after a non-flag is seen
cd weirdnames
bfs_diff -follow ',' -print
}
-function test_0073() {
- [ "$GNU" ] || return 0
+function test_fprint() {
if [ "$UPDATE" ]; then
- $BFS basic -fprint "$TESTS/test_0073.out"
- sort -o "$TESTS/test_0073.out" "$TESTS/test_0073.out"
+ $BFS basic -fprint "$TESTS/test_fprint.out"
+ sort -o "$TESTS/test_fprint.out" "$TESTS/test_fprint.out"
else
- $BFS basic -fprint scratch/test_0073.out
- sort -o scratch/test_0073.out scratch/test_0073.out
- diff -u scratch/test_0073.out "$TESTS/test_0073.out"
+ $BFS basic -fprint scratch/test_fprint.out
+ sort -o scratch/test_fprint.out scratch/test_fprint.out
+ diff -u scratch/test_fprint.out "$TESTS/test_fprint.out"
fi
}
-function test_0074() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_double_dash() {
cd basic
bfs_diff -- . -type f
}
-function test_0075() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_flag_double_dash() {
cd basic
bfs_diff -L -- . -type f
}
-function test_0076() {
- [ "$GNU" ] || return 0
-
- # Make sure -ignore_readdir_race doesn't suppress ENOENT at the root
- ! $BFS basic/nonexistent -ignore_readdir_race 2>/dev/null
-}
-
-function test_0077() {
- [ "$GNU" ] || return 0
-
+function test_ignore_readdir_race() {
rm -rf scratch/*
touch scratch/{foo,bar}
@@ -535,364 +721,299 @@ function test_0077() {
$BFS scratch -mindepth 1 -ignore_readdir_race -links 1 -exec "$TESTS/remove-sibling.sh" '{}' ';'
}
-function test_0078() {
+function test_ignore_readdir_race_root() {
+ # Make sure -ignore_readdir_race doesn't suppress ENOENT at the root
+ ! $BFS basic/nonexistent -ignore_readdir_race 2>/dev/null
+}
+
+function test_perm_222() {
bfs_diff perms -perm 222
}
-function test_0079() {
+function test_perm_222_minus() {
bfs_diff perms -perm -222
}
-function test_0080() {
- [ "$GNU" ] || return 0
+function test_perm_222_slash() {
bfs_diff perms -perm /222
}
-function test_0081() {
+function test_perm_644() {
bfs_diff perms -perm 644
}
-function test_0082() {
+function test_perm_644_minus() {
bfs_diff perms -perm -644
}
-function test_0083() {
- [ "$GNU" ] || return 0
+function test_perm_644_slash() {
bfs_diff perms -perm /644
}
-function test_0084() {
+function test_perm_symbolic() {
bfs_diff perms -perm a+r,u=wX,g+wX-w
}
-function test_0085() {
+function test_perm_symbolic_minus() {
bfs_diff perms -perm -a+r,u=wX,g+wX-w
}
-function test_0086() {
- [ "$GNU" ] || return 0
+function test_perm_symbolic_slash() {
bfs_diff perms -perm /a+r,u=wX,g+wX-w
}
-function test_0087() {
- [ "$ALL" ] || return 0
+function test_perm_symbolic_trailing_comma() {
! $BFS perms -perm a+r, 2>/dev/null
}
-function test_0088() {
- [ "$ALL" ] || return 0
+function test_perm_symbolic_double_comma() {
! $BFS perms -perm a+r,,u+w 2>/dev/null
}
-function test_0089() {
- [ "$ALL" ] || return 0
+function test_perm_symbolic_missing_action() {
! $BFS perms -perm a 2>/dev/null
}
-function test_0090() {
- bfs_diff perms -perm -+rwx
+function test_perm_leading_plus_symbolic() {
+ bfs_diff perms -perm +rwx
}
-function test_0091() {
- [ "$GNU" ] || return 0
- bfs_diff perms -perm /+rwx
+function test_perm_leading_plus_symbolic_minus() {
+ bfs_diff perms -perm -+rwx
}
-function test_0092() {
- [ "$ALL" ] || return 0
- bfs_diff perms -perm +rwx
+function test_perm_leading_plus_symbolic_slash() {
+ bfs_diff perms -perm /+rwx
}
-function test_0093() {
- [ "$ALL" ] || return 0
+function test_perm_octal_plus() {
! $BFS perms -perm +777 2>/dev/null
}
-function test_0094() {
- [ "$BSD" ] || return 0
+function test_ok_stdin() {
# -ok should *not* close stdin
# See https://savannah.gnu.org/bugs/?24561
yes | bfs_diff basic -ok bash -c "printf '%s? ' {} && head -n1" \; 2>/dev/null
}
-function test_0095() {
- [ "$BSD" ] || return 0
+function test_okdir_stdin() {
# -okdir should *not* close stdin
yes | bfs_diff basic -okdir bash -c "printf '%s? ' {} && head -n1" \; 2>/dev/null
}
-function test_0096() {
- bfs_diff basic/ -depth
-}
-
-function test_0097() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_delete_root() {
# Don't try to delete '.'
(cd scratch && $BFS . -delete)
}
-function test_0098() {
- [ "$BSD" -o "$GNU" ] || return 0
- bfs_diff / -maxdepth 0 -execdir pwd ';'
-}
-
-function test_0099() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_execdir_slash() {
# Don't prepend ./ for absolute paths in -execdir
bfs_diff / -maxdepth 0 -execdir echo '{}' ';'
}
-function test_0100() {
- [ "$ALL" ] || return 0
+function test_execdir_slash_pwd() {
+ bfs_diff / -maxdepth 0 -execdir pwd ';'
+}
+
+function test_execdir_slashes() {
bfs_diff /// -maxdepth 0 -execdir echo '{}' ';'
}
-function test_0101() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_regex() {
bfs_diff basic -regex 'basic/./.'
}
-function test_0102() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_iregex() {
bfs_diff basic -iregex 'basic/[A-Z]/[a-z]'
}
-function test_0103() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_regex_parens() {
cd weirdnames
bfs_diff . -regex '\./\((\)'
}
-function test_0104() {
- [ "$BSD" ] || return 0
+function test_E() {
cd weirdnames
bfs_diff -E . -regex '\./(\()'
}
-function test_0105() {
- [ "$GNU" ] || return 0
+function test_regextype_posix_basic() {
cd weirdnames
bfs_diff -regextype posix-basic -regex '\./\((\)'
}
-function test_0106() {
- [ "$GNU" ] || return 0
+function test_regextype_posix_extended() {
cd weirdnames
bfs_diff -regextype posix-extended -regex '\./(\()'
}
-function test_0107() {
- [ "$BSD" ] || return 0
+function test_d_path() {
bfs_diff -d basic
}
-function test_0108() {
- [ "$GNU" ] || return 0
- bfs_diff basic -d 2>/dev/null
+function test_path_d() {
+ bfs_diff basic -d
}
-function test_0109() {
- [ "$BSD" ] || return 0
+function test_f() {
cd weirdnames
bfs_diff -f '-' -f '('
}
-function test_0110() {
- [ "$ALL" ] || return 0
+function test_hidden() {
bfs_diff weirdnames -hidden
}
-function test_0111() {
- [ "$ALL" ] || return 0
+function test_nohidden() {
bfs_diff weirdnames -nohidden
}
-function test_0112() {
- [ "$BSD" ] || return 0
+function test_depth_n() {
bfs_diff basic -depth 2
}
-function test_0113() {
- [ "$BSD" ] || return 0
+function test_depth_n_plus() {
bfs_diff basic -depth +2
}
-function test_0114() {
- [ "$BSD" ] || return 0
+function test_depth_n_minus() {
bfs_diff basic -depth -2
}
-function test_0115() {
- [ "$BSD" ] || return 0
+function test_depth_depth_n() {
bfs_diff basic -depth -depth 2
}
-function test_0116() {
- [ "$BSD" ] || return 0
+function test_depth_depth_n_plus() {
bfs_diff basic -depth -depth +2
}
-function test_0117() {
- [ "$BSD" ] || return 0
+function test_depth_depth_n_minus() {
bfs_diff basic -depth -depth -2
}
-function test_0118() {
- [ "$BSD" ] || return 0
+function test_gid_name() {
bfs_diff basic -gid "$(id -gn)"
}
-function test_0119() {
- [ "$BSD" ] || return 0
+function test_uid_name() {
bfs_diff basic -uid "$(id -un)"
}
-function test_0120() {
- [ "$BSD" ] || return 0
+function test_mnewer() {
bfs_diff times -mnewer times/a
}
-function test_0121() {
- [ "$BSD" ] || return 0
+function test_H_mnewer() {
bfs_diff -H times -mnewer times/l
}
-function test_0122() {
- [ "$BSD" ] || return 0
+function test_size_T() {
bfs_diff basic -type f -size 1T
}
-function test_0123() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_quit() {
bfs_diff basic/g -print -name g -quit
}
-function test_0124() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_quit_child() {
bfs_diff basic/g -print -name h -quit
}
-function test_0125() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_quit_depth() {
bfs_diff basic/g -depth -print -name g -quit
}
-function test_0126() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_quit_depth_child() {
bfs_diff basic/g -depth -print -name h -quit
}
-function test_0127() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_quit_after_print() {
+ bfs_diff basic basic -print -quit
+}
+
+function test_quit_before_print() {
+ bfs_diff basic basic -quit -print
+}
+function test_inum() {
local inode="$(ls -id basic/k/foo/bar | cut -f1 -d' ')"
bfs_diff basic -inum "$inode"
}
-function test_0128() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_nogroup() {
bfs_diff basic -nogroup
}
-function test_0129() {
- [ "$BSD" -o "$GNU" ] || return 0
+function test_nouser() {
bfs_diff basic -nouser
}
-function test_0130() {
- [ "$GNU" ] || return 0
+function test_printf() {
bfs_diff basic -printf '%%p(%p) %%d(%d) %%f(%f) %%h(%h) %%H(%H) %%P(%P) %%m(%m) %%M(%M) %%y(%y)\n'
}
-function test_0131() {
- [ "$GNU" ] || return 0
+function test_printf_slash() {
bfs_diff / -maxdepth 0 -printf '(%h)/(%f)\n'
}
-function test_0132() {
- [ "$GNU" ] || return 0
+function test_printf_slashes() {
bfs_diff /// -maxdepth 0 -printf '(%h)/(%f)\n'
}
-function test_0133() {
- [ "$GNU" ] || return 0
+function test_printf_trailing_slash() {
bfs_diff basic/ -printf '(%h)/(%f)\n'
}
-function test_0134() {
- [ "$GNU" ] || return 0
+function test_printf_trailing_slashes() {
bfs_diff basic/// -printf '(%h)/(%f)\n'
}
-function test_0135() {
- [ "$GNU" ] || return 0
+function test_printf_flags() {
bfs_diff basic -printf '|%- 10.10p| %+03d %#4m\n'
}
-function test_0136() {
- [ "$GNU" ] || return 0
+function test_printf_types() {
bfs_diff links -printf '(%p) (%l) %y %Y\n'
}
-function test_0137() {
- [ "$GNU" ] || return 0
+function test_printf_escapes() {
bfs_diff basic -maxdepth 0 -printf '\18\118\1118\11118\n\cfoo'
}
-function test_0138() {
- bfs_diff basic/g -depth -name g
-}
-
-function test_0139() {
- [ "$BSD" -o "$GNU" ] || return 0
- bfs_diff basic basic -print -quit
-}
-
-function test_0140() {
- [ "$BSD" -o "$GNU" ] || return 0
- bfs_diff basic basic -quit -print
-}
-
-function test_0141() {
+function test_printf_leak() {
# Memory leak regression test
- [ "$GNU" ] || return 0
bfs_diff basic -maxdepth 0 -printf '%p'
}
-function test_0142() {
- [ "$ALL" ] || return 0
- bfs_diff links -type f,d,c
-}
-
-function test_0143() {
- [ "$ALL" ] || return 0
- bfs_diff links -xtype f,d,c
-}
-
result=0
-for i in {1..143}; do
- test="test_$(printf '%04d' $i)"
-
+for test in "${!run_tests[@]}"; do
if [ -t 1 ]; then
- printf '\r%s' "$test"
+ printf '\r\033[J%s' "$test"
+ else
+ echo "$test"
fi
("$test" "$dir")
status=$?
if [ $status -ne 0 ]; then
- if [ -t 1 ]; then
- printf '\r%s failed!\n' "$test"
- else
- printf '%s failed!\n' "$test"
- fi
+ echo "$test failed!"
result=$status
fi
done
+if [ $result -eq 0 ]; then
+ status=passed
+else
+ status=failed
+fi
+
if [ -t 1 ]; then
- printf '\n'
+ printf '\r\033[Jtests %s\n' "$status"
+else
+ echo "tests $status"
fi
exit $result
diff --git a/tests/test_0103.out b/tests/test_E.out
index 0f0971e..0f0971e 100644
--- a/tests/test_0103.out
+++ b/tests/test_E.out
diff --git a/tests/test_0027.out b/tests/test_H.out
index a4beda4..a4beda4 100644
--- a/tests/test_0027.out
+++ b/tests/test_H.out
diff --git a/tests/test_0032.out b/tests/test_H_broken.out
index e5e13fc..e5e13fc 100644
--- a/tests/test_0032.out
+++ b/tests/test_H_broken.out
diff --git a/tests/test_0022.out b/tests/test_H_mnewer.out
index 7f6c0dd..7f6c0dd 100644
--- a/tests/test_0022.out
+++ b/tests/test_H_mnewer.out
diff --git a/tests/test_0023.out b/tests/test_H_newer.out
index 7f6c0dd..7f6c0dd 100644
--- a/tests/test_0023.out
+++ b/tests/test_H_newer.out
diff --git a/tests/test_0028.out b/tests/test_H_slash.out
index 0a4fc77..0a4fc77 100644
--- a/tests/test_0028.out
+++ b/tests/test_H_slash.out
diff --git a/tests/test_0033.out b/tests/test_L.out
index 36087e8..36087e8 100644
--- a/tests/test_0033.out
+++ b/tests/test_L.out
diff --git a/tests/test_0034.out b/tests/test_L_depth.out
index 36087e8..36087e8 100644
--- a/tests/test_0034.out
+++ b/tests/test_L_depth.out
diff --git a/tests/test_0049.out b/tests/test_L_ilname.out
index b7e42dd..b7e42dd 100644
--- a/tests/test_0049.out
+++ b/tests/test_L_ilname.out
diff --git a/tests/test_0050.out b/tests/test_L_lname.out
index b7e42dd..b7e42dd 100644
--- a/tests/test_0050.out
+++ b/tests/test_L_lname.out
diff --git a/tests/test_0024.out b/tests/test_L_xtype_f.out
index 892c879..892c879 100644
--- a/tests/test_0024.out
+++ b/tests/test_L_xtype_f.out
diff --git a/tests/test_0039.out b/tests/test_L_xtype_l.out
index 1052fc0..1052fc0 100644
--- a/tests/test_0039.out
+++ b/tests/test_L_xtype_l.out
diff --git a/tests/test_0029.out b/tests/test_P.out
index a4beda4..a4beda4 100644
--- a/tests/test_0029.out
+++ b/tests/test_P.out
diff --git a/tests/test_0030.out b/tests/test_P_slash.out
index 0a4fc77..0a4fc77 100644
--- a/tests/test_0030.out
+++ b/tests/test_P_slash.out
diff --git a/tests/test_0031.out b/tests/test_anewer.out
index 7f6c0dd..7f6c0dd 100644
--- a/tests/test_0031.out
+++ b/tests/test_anewer.out
diff --git a/tests/test_0001.out b/tests/test_basic.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0001.out
+++ b/tests/test_basic.out
diff --git a/tests/test_0068.out b/tests/test_comma.out
index 56b2bde..56b2bde 100644
--- a/tests/test_0068.out
+++ b/tests/test_comma.out
diff --git a/tests/test_0016.out b/tests/test_d_path.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0016.out
+++ b/tests/test_d_path.out
diff --git a/tests/test_0017.out b/tests/test_daystart.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0017.out
+++ b/tests/test_daystart.out
diff --git a/tests/test_0018.out b/tests/test_daystart_twice.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0018.out
+++ b/tests/test_daystart_twice.out
diff --git a/tests/test_0019.out b/tests/test_depth.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0019.out
+++ b/tests/test_depth.out
diff --git a/tests/test_0112.out b/tests/test_depth_depth_n.out
index 3bfc1d3..3bfc1d3 100644
--- a/tests/test_0112.out
+++ b/tests/test_depth_depth_n.out
diff --git a/tests/test_0005.out b/tests/test_depth_depth_n_minus.out
index 7575ae4..7575ae4 100644
--- a/tests/test_0005.out
+++ b/tests/test_depth_depth_n_minus.out
diff --git a/tests/test_0113.out b/tests/test_depth_depth_n_plus.out
index 847995d..847995d 100644
--- a/tests/test_0113.out
+++ b/tests/test_depth_depth_n_plus.out
diff --git a/tests/test_0008.out b/tests/test_depth_maxdepth_1.out
index 7575ae4..7575ae4 100644
--- a/tests/test_0008.out
+++ b/tests/test_depth_maxdepth_1.out
diff --git a/tests/test_0009.out b/tests/test_depth_maxdepth_2.out
index b79fef1..b79fef1 100644
--- a/tests/test_0009.out
+++ b/tests/test_depth_maxdepth_2.out
diff --git a/tests/test_0004.out b/tests/test_depth_mindepth_1.out
index 1f00c58..1f00c58 100644
--- a/tests/test_0004.out
+++ b/tests/test_depth_mindepth_1.out
diff --git a/tests/test_0007.out b/tests/test_depth_mindepth_2.out
index 4198bf9..4198bf9 100644
--- a/tests/test_0007.out
+++ b/tests/test_depth_mindepth_2.out
diff --git a/tests/test_0115.out b/tests/test_depth_n.out
index 3bfc1d3..3bfc1d3 100644
--- a/tests/test_0115.out
+++ b/tests/test_depth_n.out
diff --git a/tests/test_0114.out b/tests/test_depth_n_minus.out
index 7575ae4..7575ae4 100644
--- a/tests/test_0114.out
+++ b/tests/test_depth_n_minus.out
diff --git a/tests/test_0116.out b/tests/test_depth_n_plus.out
index 847995d..847995d 100644
--- a/tests/test_0116.out
+++ b/tests/test_depth_n_plus.out
diff --git a/tests/test_0096.out b/tests/test_depth_slash.out
index 7ce7a82..7ce7a82 100644
--- a/tests/test_0096.out
+++ b/tests/test_depth_slash.out
diff --git a/tests/test_0074.out b/tests/test_double_dash.out
index 774cc7c..774cc7c 100644
--- a/tests/test_0074.out
+++ b/tests/test_double_dash.out
diff --git a/tests/test_0015.out b/tests/test_empty.out
index 81bdb0a..81bdb0a 100644
--- a/tests/test_0015.out
+++ b/tests/test_empty.out
diff --git a/tests/test_0020.out b/tests/test_exec.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0020.out
+++ b/tests/test_exec.out
diff --git a/tests/test_0063.out b/tests/test_exec_substring.out
index 1c58fb2..1c58fb2 100644
--- a/tests/test_0063.out
+++ b/tests/test_exec_substring.out
diff --git a/tests/test_0065.out b/tests/test_execdir.out
index 62b31f6..62b31f6 100644
--- a/tests/test_0065.out
+++ b/tests/test_execdir.out
diff --git a/tests/test_0064.out b/tests/test_execdir_pwd.out
index e66db9a..e66db9a 100644
--- a/tests/test_0064.out
+++ b/tests/test_execdir_pwd.out
diff --git a/tests/test_0043.out b/tests/test_execdir_slash.out
index b498fd4..b498fd4 100644
--- a/tests/test_0043.out
+++ b/tests/test_execdir_slash.out
diff --git a/tests/test_0098.out b/tests/test_execdir_slash_pwd.out
index b498fd4..b498fd4 100644
--- a/tests/test_0098.out
+++ b/tests/test_execdir_slash_pwd.out
diff --git a/tests/test_0044.out b/tests/test_execdir_slashes.out
index 187b81f..187b81f 100644
--- a/tests/test_0044.out
+++ b/tests/test_execdir_slashes.out
diff --git a/tests/test_0066.out b/tests/test_execdir_substring.out
index f7a9ac0..f7a9ac0 100644
--- a/tests/test_0066.out
+++ b/tests/test_execdir_substring.out
diff --git a/tests/test_0012.out b/tests/test_executable.out
index 49c1b21..49c1b21 100644
--- a/tests/test_0012.out
+++ b/tests/test_executable.out
diff --git a/tests/test_0109.out b/tests/test_f.out
index 2998538..2998538 100644
--- a/tests/test_0109.out
+++ b/tests/test_f.out
diff --git a/tests/test_0071.out b/tests/test_flag_comma.out
index 3574388..3574388 100644
--- a/tests/test_0071.out
+++ b/tests/test_flag_comma.out
diff --git a/tests/test_0075.out b/tests/test_flag_double_dash.out
index 774cc7c..774cc7c 100644
--- a/tests/test_0075.out
+++ b/tests/test_flag_double_dash.out
diff --git a/tests/test_0069.out b/tests/test_flag_weird_names.out
index 73d0ff3..73d0ff3 100644
--- a/tests/test_0069.out
+++ b/tests/test_flag_weird_names.out
diff --git a/tests/test_0035.out b/tests/test_follow.out
index 36087e8..36087e8 100644
--- a/tests/test_0035.out
+++ b/tests/test_follow.out
diff --git a/tests/test_0072.out b/tests/test_follow_comma.out
index a4d5860..a4d5860 100644
--- a/tests/test_0072.out
+++ b/tests/test_follow_comma.out
diff --git a/tests/test_0073.out b/tests/test_fprint.out
index a7ccfe4..a7ccfe4 100644
--- a/tests/test_0073.out
+++ b/tests/test_fprint.out
diff --git a/tests/test_0021.out b/tests/test_gid.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0021.out
+++ b/tests/test_gid.out
diff --git a/tests/test_0051.out b/tests/test_gid_minus.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0051.out
+++ b/tests/test_gid_minus.out
diff --git a/tests/test_0052.out b/tests/test_gid_name.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0052.out
+++ b/tests/test_gid_name.out
diff --git a/tests/test_0053.out b/tests/test_gid_plus.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0053.out
+++ b/tests/test_gid_plus.out
diff --git a/tests/test_0054.out b/tests/test_group_id.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0054.out
+++ b/tests/test_group_id.out
diff --git a/tests/test_0055.out b/tests/test_group_name.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0055.out
+++ b/tests/test_group_name.out
diff --git a/tests/test_0110.out b/tests/test_hidden.out
index e65ede9..e65ede9 100644
--- a/tests/test_0110.out
+++ b/tests/test_hidden.out
diff --git a/tests/test_0047.out b/tests/test_ilname.out
index 45cc127..45cc127 100644
--- a/tests/test_0047.out
+++ b/tests/test_ilname.out
diff --git a/tests/test_0010.out b/tests/test_iname.out
index a9e5d42..a9e5d42 100644
--- a/tests/test_0010.out
+++ b/tests/test_iname.out
diff --git a/tests/test_0127.out b/tests/test_inum.out
index ebcaf79..ebcaf79 100644
--- a/tests/test_0127.out
+++ b/tests/test_inum.out
diff --git a/tests/test_0011.out b/tests/test_ipath.out
index 0d36df9..0d36df9 100644
--- a/tests/test_0011.out
+++ b/tests/test_ipath.out
diff --git a/tests/test_0101.out b/tests/test_iregex.out
index cfc113b..cfc113b 100644
--- a/tests/test_0101.out
+++ b/tests/test_iregex.out
diff --git a/tests/test_0026.out b/tests/test_links.out
index 892c879..892c879 100644
--- a/tests/test_0026.out
+++ b/tests/test_links.out
diff --git a/tests/test_0025.out b/tests/test_links_minus.out
index e69de29..e69de29 100644
--- a/tests/test_0025.out
+++ b/tests/test_links_minus.out
diff --git a/tests/test_0036.out b/tests/test_links_plus.out
index 892c879..892c879 100644
--- a/tests/test_0036.out
+++ b/tests/test_links_plus.out
diff --git a/tests/test_0048.out b/tests/test_lname.out
index 45cc127..45cc127 100644
--- a/tests/test_0048.out
+++ b/tests/test_lname.out
diff --git a/tests/test_0117.out b/tests/test_maxdepth.out
index 7575ae4..7575ae4 100644
--- a/tests/test_0117.out
+++ b/tests/test_maxdepth.out
diff --git a/tests/test_0006.out b/tests/test_mindepth.out
index 1f00c58..1f00c58 100644
--- a/tests/test_0006.out
+++ b/tests/test_mindepth.out
diff --git a/tests/test_0057.out b/tests/test_mnewer.out
index 7f6c0dd..7f6c0dd 100644
--- a/tests/test_0057.out
+++ b/tests/test_mnewer.out
diff --git a/tests/test_0045.out b/tests/test_name.out
index a9e5d42..a9e5d42 100644
--- a/tests/test_0045.out
+++ b/tests/test_name.out
diff --git a/tests/test_0041.out b/tests/test_name_root.out
index 511198f..511198f 100644
--- a/tests/test_0041.out
+++ b/tests/test_name_root.out
diff --git a/tests/test_0123.out b/tests/test_name_root_depth.out
index cf4d5a9..cf4d5a9 100644
--- a/tests/test_0123.out
+++ b/tests/test_name_root_depth.out
diff --git a/tests/test_0099.out b/tests/test_name_slash.out
index b498fd4..b498fd4 100644
--- a/tests/test_0099.out
+++ b/tests/test_name_slash.out
diff --git a/tests/test_0100.out b/tests/test_name_slashes.out
index 187b81f..187b81f 100644
--- a/tests/test_0100.out
+++ b/tests/test_name_slashes.out
diff --git a/tests/test_0042.out b/tests/test_name_trailing_slash.out
index daff2f5..daff2f5 100644
--- a/tests/test_0042.out
+++ b/tests/test_name_trailing_slash.out
diff --git a/tests/test_0120.out b/tests/test_newer.out
index 7f6c0dd..7f6c0dd 100644
--- a/tests/test_0120.out
+++ b/tests/test_newer.out
diff --git a/tests/test_0121.out b/tests/test_newerma.out
index 7f6c0dd..7f6c0dd 100644
--- a/tests/test_0121.out
+++ b/tests/test_newerma.out
diff --git a/tests/test_0061.out b/tests/test_nogroup.out
index e69de29..e69de29 100644
--- a/tests/test_0061.out
+++ b/tests/test_nogroup.out
diff --git a/tests/test_0111.out b/tests/test_nohidden.out
index e505d02..e505d02 100644
--- a/tests/test_0111.out
+++ b/tests/test_nohidden.out
diff --git a/tests/test_0084.out b/tests/test_nouser.out
index e69de29..e69de29 100644
--- a/tests/test_0084.out
+++ b/tests/test_nouser.out
diff --git a/tests/test_0094.out b/tests/test_ok_stdin.out
index 30b57fd..30b57fd 100644
--- a/tests/test_0094.out
+++ b/tests/test_ok_stdin.out
diff --git a/tests/test_0095.out b/tests/test_okdir_stdin.out
index ef2a68b..ef2a68b 100644
--- a/tests/test_0095.out
+++ b/tests/test_okdir_stdin.out
diff --git a/tests/test_0067.out b/tests/test_parens.out
index a9e5d42..a9e5d42 100644
--- a/tests/test_0067.out
+++ b/tests/test_parens.out
diff --git a/tests/test_0046.out b/tests/test_path.out
index 0d36df9..0d36df9 100644
--- a/tests/test_0046.out
+++ b/tests/test_path.out
diff --git a/tests/test_0056.out b/tests/test_path_d.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0056.out
+++ b/tests/test_path_d.out
diff --git a/tests/test_0078.out b/tests/test_perm_222.out
index 1690e43..1690e43 100644
--- a/tests/test_0078.out
+++ b/tests/test_perm_222.out
diff --git a/tests/test_0079.out b/tests/test_perm_222_minus.out
index 1690e43..1690e43 100644
--- a/tests/test_0079.out
+++ b/tests/test_perm_222_minus.out
diff --git a/tests/test_0014.out b/tests/test_perm_222_slash.out
index 9a5b95a..9a5b95a 100644
--- a/tests/test_0014.out
+++ b/tests/test_perm_222_slash.out
diff --git a/tests/test_0081.out b/tests/test_perm_644.out
index 4e64e49..4e64e49 100644
--- a/tests/test_0081.out
+++ b/tests/test_perm_644.out
diff --git a/tests/test_0082.out b/tests/test_perm_644_minus.out
index 2e2576b..2e2576b 100644
--- a/tests/test_0082.out
+++ b/tests/test_perm_644_minus.out
diff --git a/tests/test_0083.out b/tests/test_perm_644_slash.out
index 7e5ae98..7e5ae98 100644
--- a/tests/test_0083.out
+++ b/tests/test_perm_644_slash.out
diff --git a/tests/test_0090.out b/tests/test_perm_leading_plus_symbolic.out
index e69de29..e69de29 100644
--- a/tests/test_0090.out
+++ b/tests/test_perm_leading_plus_symbolic.out
diff --git a/tests/test_0092.out b/tests/test_perm_leading_plus_symbolic_minus.out
index e69de29..e69de29 100644
--- a/tests/test_0092.out
+++ b/tests/test_perm_leading_plus_symbolic_minus.out
diff --git a/tests/test_0086.out b/tests/test_perm_leading_plus_symbolic_slash.out
index 7e5ae98..7e5ae98 100644
--- a/tests/test_0086.out
+++ b/tests/test_perm_leading_plus_symbolic_slash.out
diff --git a/tests/test_0128.out b/tests/test_perm_symbolic.out
index e69de29..e69de29 100644
--- a/tests/test_0128.out
+++ b/tests/test_perm_symbolic.out
diff --git a/tests/test_0085.out b/tests/test_perm_symbolic_minus.out
index 2e2576b..2e2576b 100644
--- a/tests/test_0085.out
+++ b/tests/test_perm_symbolic_minus.out
diff --git a/tests/test_0091.out b/tests/test_perm_symbolic_slash.out
index 7e5ae98..7e5ae98 100644
--- a/tests/test_0091.out
+++ b/tests/test_perm_symbolic_slash.out
diff --git a/tests/test_0130.out b/tests/test_printf.out
index 801ddbb..801ddbb 100644
--- a/tests/test_0130.out
+++ b/tests/test_printf.out
diff --git a/tests/test_0137.out b/tests/test_printf_escapes.out
index 20ea120..20ea120 100644
--- a/tests/test_0137.out
+++ b/tests/test_printf_escapes.out
diff --git a/tests/test_0135.out b/tests/test_printf_flags.out
index 1a92b6e..1a92b6e 100644
--- a/tests/test_0135.out
+++ b/tests/test_printf_flags.out
diff --git a/tests/test_0139.out b/tests/test_printf_leak.out
index 15a13db..15a13db 100644
--- a/tests/test_0139.out
+++ b/tests/test_printf_leak.out
diff --git a/tests/test_0131.out b/tests/test_printf_slash.out
index 5571971..5571971 100644
--- a/tests/test_0131.out
+++ b/tests/test_printf_slash.out
diff --git a/tests/test_0132.out b/tests/test_printf_slashes.out
index 60710e5..60710e5 100644
--- a/tests/test_0132.out
+++ b/tests/test_printf_slashes.out
diff --git a/tests/test_0133.out b/tests/test_printf_trailing_slash.out
index 0aa4ffc..0aa4ffc 100644
--- a/tests/test_0133.out
+++ b/tests/test_printf_trailing_slash.out
diff --git a/tests/test_0134.out b/tests/test_printf_trailing_slashes.out
index cbb54a8..cbb54a8 100644
--- a/tests/test_0134.out
+++ b/tests/test_printf_trailing_slashes.out
diff --git a/tests/test_0136.out b/tests/test_printf_types.out
index 94fa833..94fa833 100644
--- a/tests/test_0136.out
+++ b/tests/test_printf_types.out
diff --git a/tests/test_0138.out b/tests/test_quit.out
index cf4d5a9..cf4d5a9 100644
--- a/tests/test_0138.out
+++ b/tests/test_quit.out
diff --git a/tests/test_0141.out b/tests/test_quit_after_print.out
index 15a13db..15a13db 100644
--- a/tests/test_0141.out
+++ b/tests/test_quit_after_print.out
diff --git a/tests/test_0129.out b/tests/test_quit_before_print.out
index e69de29..e69de29 100644
--- a/tests/test_0129.out
+++ b/tests/test_quit_before_print.out
diff --git a/tests/test_0124.out b/tests/test_quit_child.out
index fb683c7..fb683c7 100644
--- a/tests/test_0124.out
+++ b/tests/test_quit_child.out
diff --git a/tests/test_0125.out b/tests/test_quit_depth.out
index fb683c7..fb683c7 100644
--- a/tests/test_0125.out
+++ b/tests/test_quit_depth.out
diff --git a/tests/test_0126.out b/tests/test_quit_depth_child.out
index 72b086d..72b086d 100644
--- a/tests/test_0126.out
+++ b/tests/test_quit_depth_child.out
diff --git a/tests/test_0013.out b/tests/test_readable.out
index 386feba..386feba 100644
--- a/tests/test_0013.out
+++ b/tests/test_readable.out
diff --git a/tests/test_0102.out b/tests/test_regex.out
index cfc113b..cfc113b 100644
--- a/tests/test_0102.out
+++ b/tests/test_regex.out
diff --git a/tests/test_0104.out b/tests/test_regex_parens.out
index 0f0971e..0f0971e 100644
--- a/tests/test_0104.out
+++ b/tests/test_regex_parens.out
diff --git a/tests/test_0105.out b/tests/test_regextype_posix_basic.out
index 0f0971e..0f0971e 100644
--- a/tests/test_0105.out
+++ b/tests/test_regextype_posix_basic.out
diff --git a/tests/test_0106.out b/tests/test_regextype_posix_extended.out
index 0f0971e..0f0971e 100644
--- a/tests/test_0106.out
+++ b/tests/test_regextype_posix_extended.out
diff --git a/tests/test_0040.out b/tests/test_samefile.out
index 892c879..892c879 100644
--- a/tests/test_0040.out
+++ b/tests/test_samefile.out
diff --git a/tests/test_0058.out b/tests/test_size.out
index eeabbd7..eeabbd7 100644
--- a/tests/test_0058.out
+++ b/tests/test_size.out
diff --git a/tests/test_0059.out b/tests/test_size_T.out
index 279f3f1..279f3f1 100644
--- a/tests/test_0059.out
+++ b/tests/test_size_T.out
diff --git a/tests/test_0140.out b/tests/test_size_big.out
index e69de29..e69de29 100644
--- a/tests/test_0140.out
+++ b/tests/test_size_big.out
diff --git a/tests/test_0060.out b/tests/test_size_bytes.out
index 279f3f1..279f3f1 100644
--- a/tests/test_0060.out
+++ b/tests/test_size_bytes.out
diff --git a/tests/test_0122.out b/tests/test_size_plus.out
index 279f3f1..279f3f1 100644
--- a/tests/test_0122.out
+++ b/tests/test_size_plus.out
diff --git a/tests/test_0002.out b/tests/test_type_d.out
index 1e72fd9..1e72fd9 100644
--- a/tests/test_0002.out
+++ b/tests/test_type_d.out
diff --git a/tests/test_0003.out b/tests/test_type_f.out
index 6218a0c..6218a0c 100644
--- a/tests/test_0003.out
+++ b/tests/test_type_f.out
diff --git a/tests/test_0142.out b/tests/test_type_multi.out
index 1f94970..1f94970 100644
--- a/tests/test_0142.out
+++ b/tests/test_type_multi.out
diff --git a/tests/test_0062.out b/tests/test_uid.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0062.out
+++ b/tests/test_uid.out
diff --git a/tests/test_0107.out b/tests/test_uid_minus.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0107.out
+++ b/tests/test_uid_minus.out
diff --git a/tests/test_0108.out b/tests/test_uid_name.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0108.out
+++ b/tests/test_uid_name.out
diff --git a/tests/test_0118.out b/tests/test_uid_plus.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0118.out
+++ b/tests/test_uid_plus.out
diff --git a/tests/test_0119.out b/tests/test_user_id.out
index bb3cd8d..bb3cd8d 100644
--- a/tests/test_0119.out
+++ b/tests/test_user_id.out
diff --git a/tests/test_user_name.out b/tests/test_user_name.out
new file mode 100644
index 0000000..bb3cd8d
--- /dev/null
+++ b/tests/test_user_name.out
@@ -0,0 +1,19 @@
+basic
+basic/a
+basic/b
+basic/c
+basic/e
+basic/g
+basic/i
+basic/j
+basic/k
+basic/l
+basic/c/d
+basic/e/f
+basic/g/h
+basic/j/foo
+basic/k/foo
+basic/l/foo
+basic/k/foo/bar
+basic/l/foo/bar
+basic/l/foo/bar/baz
diff --git a/tests/test_0070.out b/tests/test_weird_names.out
index 73d0ff3..73d0ff3 100644
--- a/tests/test_0070.out
+++ b/tests/test_weird_names.out
diff --git a/tests/test_0080.out b/tests/test_writable.out
index 9a5b95a..9a5b95a 100644
--- a/tests/test_0080.out
+++ b/tests/test_writable.out
diff --git a/tests/test_0038.out b/tests/test_xtype_f.out
index 2a65132..2a65132 100644
--- a/tests/test_0038.out
+++ b/tests/test_xtype_f.out
diff --git a/tests/test_0037.out b/tests/test_xtype_l.out
index e5e13fc..e5e13fc 100644
--- a/tests/test_0037.out
+++ b/tests/test_xtype_l.out
diff --git a/tests/test_0143.out b/tests/test_xtype_multi.out
index 8849bb9..8849bb9 100644
--- a/tests/test_0143.out
+++ b/tests/test_xtype_multi.out