diff options
Diffstat (limited to 'tests/seq.test')
-rwxr-xr-x | tests/seq.test | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/tests/seq.test b/tests/seq.test index c9e1c019..71079785 100755 --- a/tests/seq.test +++ b/tests/seq.test @@ -4,45 +4,45 @@ #testing "name" "command" "result" "infile" "stdin" -testing "seq (exit with error)" "seq 2> /dev/null || echo yes" "yes\n" "" "" -testing "seq (exit with error)" "seq 1 2 3 4 2> /dev/null || echo yes" \ +testing "(exit with error)" "seq 2> /dev/null || echo yes" "yes\n" "" "" +testing "(exit with error)" "seq 1 2 3 4 2> /dev/null || echo yes" \ "yes\n" "" "" -testing "seq one argument" "seq 3" "1\n2\n3\n" "" "" -testing "seq two arguments" "seq 5 7" "5\n6\n7\n" "" "" -testing "seq two arguments reversed" "seq 7 5" "" "" "" -testing "seq two arguments equal" "seq 3 3" "3\n" "" "" -testing "seq two arguments equal, arbitrary negative step" "seq 1 -15 1" \ +testing "one argument" "seq 3" "1\n2\n3\n" "" "" +testing "two arguments" "seq 5 7" "5\n6\n7\n" "" "" +testing "two arguments reversed" "seq 7 5" "" "" "" +testing "two arguments equal" "seq 3 3" "3\n" "" "" +testing "two arguments equal, arbitrary negative step" "seq 1 -15 1" \ "1\n" "" "" -testing "seq two arguments equal, arbitrary positive step" "seq 1 +15 1" \ +testing "two arguments equal, arbitrary positive step" "seq 1 +15 1" \ "1\n" "" "" -testing "seq count up by 2" "seq 4 2 8" "4\n6\n8\n" "" "" -testing "seq count down by 2" "seq 8 -2 4" "8\n6\n4\n" "" "" -testing "seq count wrong way #1" "seq 4 -2 8" "" "" "" -testing "seq count wrong way #2" "seq 8 2 4" "" "" "" -testing "seq count by .3" "seq 3 .3 4" "3\n3.3\n3.6\n3.9\n" "" "" -testing "seq count by -.9" "seq .7 -.9 -2.2" "0.7\n-0.2\n-1.1\n-2\n" "" "" -testing "seq count by zero" "seq 4 0 8 | head -n 10" "" "" "" -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 "count up by 2" "seq 4 2 8" "4\n6\n8\n" "" "" +testing "count down by 2" "seq 8 -2 4" "8\n6\n4\n" "" "" +testing "count wrong way #1" "seq 4 -2 8" "" "" "" +testing "count wrong way #2" "seq 8 2 4" "" "" "" +testing "count by .3" "seq 3 .3 4" "3\n3.3\n3.6\n3.9\n" "" "" +testing "count by -.9" "seq .7 -.9 -2.2" "0.7\n-0.2\n-1.1\n-2\n" "" "" +testing "count by zero" "seq 4 0 8 | head -n 10" "" "" "" +testing "separator -" "seq -s - 1 3" "1-2-3\n" "" "" +testing "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" "" "" -testing "seq padding" "seq -s, -w -2 19 120" "-02,017,036,055,074,093,112\n" \ +testing "separator and format string" "seq -f \%03g -s \; 5 -1 0" "005;004;003;002;001;000\n" "" "" +testing "padding" "seq -s, -w -2 19 120" "-02,017,036,055,074,093,112\n" \ "" "" -testing "seq padding" "seq -s, -w -2 3 12" "-2,01,04,07,10\n" "" "" -testing "seq padding" "seq -s, -w -2.2 3.3 12" "-2.2,01.1,04.4,07.7,11.0\n" \ +testing "padding" "seq -s, -w -2 3 12" "-2,01,04,07,10\n" "" "" +testing "padding" "seq -s, -w -2.2 3.3 12" "-2.2,01.1,04.4,07.7,11.0\n" \ "" "" # Test -f format filtering for i in %f %e %g "boo %f yah" "% f" %-1.2f %+-f "%+ - f" %.2f %3.f "%'.2f" \ %%%f%% do - testing "seq filter -f \"$i\"" "seq -f \"$i\" 1 3 > /dev/null && echo yes" \ + testing "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 %%%f%%% do - testing "seq filter reject -f '$i'" \ + testing "filter reject -f '$i'" \ "seq -f '$i' 1 3 2>/dev/null || echo no" "no\n" "" "" done |