From 352b9eaf4479d204c617c68744de9ba075078308 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 21 Mar 2020 11:48:06 -0400 Subject: Implement -s flag from FreeBSD find to sort results --- tests.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'tests.sh') diff --git a/tests.sh b/tests.sh index 711bbb6..4b0771e 100755 --- a/tests.sh +++ b/tests.sh @@ -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' -- cgit v1.2.3