summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-03-21 11:48:06 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-03-21 12:05:14 -0400
commit352b9eaf4479d204c617c68744de9ba075078308 (patch)
treec67cb5e4389c9ae00e3e748cd1dd8002911f44f8 /tests.sh
parentaacf8aa796c3120ff65e3c0a2cbdddcf60c1777e (diff)
downloadbfs-352b9eaf4479d204c617c68744de9ba075078308.tar.xz
Implement -s flag from FreeBSD find to sort results
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh40
1 files changed, 40 insertions, 0 deletions
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'