diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-03-21 11:48:06 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-03-21 12:05:14 -0400 |
commit | 352b9eaf4479d204c617c68744de9ba075078308 (patch) | |
tree | c67cb5e4389c9ae00e3e748cd1dd8002911f44f8 /tests.sh | |
parent | aacf8aa796c3120ff65e3c0a2cbdddcf60c1777e (diff) | |
download | bfs-352b9eaf4479d204c617c68744de9ba075078308.tar.xz |
Implement -s flag from FreeBSD find to sort results
Diffstat (limited to 'tests.sh')
-rwxr-xr-x | tests.sh | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -272,6 +272,8 @@ bsd_tests=( test_f + test_s + test_double_dash test_flag_double_dash @@ -591,6 +593,12 @@ bfs_tests=( test_expr_flag_path test_expr_path_flag + # Flags + + test_S_bfs + test_S_dfs + test_S_ids + # Primaries test_color @@ -1745,6 +1753,16 @@ function test_f() { bfs_diff -f '-' -f '(' } +function test_s() { + invoke_bfs -s weirdnames -maxdepth 1 >"$TMP/test_s.out" + + if [ "$UPDATE" ]; then + cp {"$TMP","$TESTS"}/test_s.out + else + diff -u {"$TESTS","$TMP"}/test_s.out + fi +} + function test_hidden() { bfs_diff weirdnames -hidden } @@ -2568,6 +2586,28 @@ function test_help() { return 0 } +function test_S() { + invoke_bfs -S "$1" -s basic >"$TMP/test_S_$1.out" + + if [ "$UPDATE" ]; then + cp {"$TMP","$TESTS"}/"test_S_$1.out" + else + diff -u {"$TESTS","$TMP"}/"test_S_$1.out" + fi +} + +function test_S_bfs() { + test_S bfs +} + +function test_S_dfs() { + test_S dfs +} + +function test_S_ids() { + test_S ids +} + BOL= EOL='\n' |