aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-09-05 05:46:35 -0500
committerRob Landley <rob@landley.net>2015-09-05 05:46:35 -0500
commit73eca9182dfd7c2d52775ca24da6a7a0d55b3cee (patch)
tree0dcbf9b1d058d131ddbbdec9bcc759287999d071 /tests
parent091997e4c6f5655876a3133ae80b52c2d91a8216 (diff)
downloadtoybox-73eca9182dfd7c2d52775ca24da6a7a0d55b3cee.tar.gz
Add seq -f tests, tweak help text, and catch one more error case.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/seq.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/seq.test b/tests/seq.test
index 3f3b4099..4d23f8e2 100755
--- a/tests/seq.test
+++ b/tests/seq.test
@@ -26,3 +26,17 @@ testing "seq separator -" "seq -s - 1 3" "1-2-3\n" "" ""
testing "seq format string" 'seq -f %+01g -10 5 10' "-10\n-5\n+0\n+5\n+10\n" "" ""
testing "seq separator and format string" "seq -f \%03g -s \; 5 -1 0" "005;004;003;002;001;000\n" "" ""
+# Test -f format filtering
+for i in %f %e %g "boo %f yah" "% f" %-1.2f %+-f "%+ - f" %.2f %3.f "%'.2f" \
+ %%%f%% %%%f%%%
+do
+ testing "seq filter -f \"$i\"" "seq -f \"$i\" 1 3 > /dev/null && echo yes" \
+ "yes\n" "" ""
+done
+# Test -f format filtering failures
+for i in %d %s "" "boo %f %f yah" "%*f" %-1.2.3f '%2$f' %1-f "%1 f" \
+ %2..2f
+do
+ testing "seq filter reject -f '$i'" \
+ "seq -f '$i' 1 3 2>/dev/null || echo no" "no\n" "" ""
+done