diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gzip/gzip-compression-levels | 5 | ||||
-rwxr-xr-x | testsuite/md5sum.tests | 22 | ||||
-rwxr-xr-x | testsuite/sed.tests | 6 | ||||
-rwxr-xr-x | testsuite/sha3sum.tests | 2 |
4 files changed, 24 insertions, 11 deletions
diff --git a/testsuite/gzip/gzip-compression-levels b/testsuite/gzip/gzip-compression-levels new file mode 100644 index 000000000..6d9a13d08 --- /dev/null +++ b/testsuite/gzip/gzip-compression-levels | |||
@@ -0,0 +1,5 @@ | |||
1 | # FEATURE: CONFIG_FEATURE_GZIP_LEVELS | ||
2 | |||
3 | level1=$(busybox gzip -c -1 $(which busybox) | wc -c) | ||
4 | level9=$(busybox gzip -c -9 $(which busybox) | wc -c) | ||
5 | test $level1 -gt $level9 | ||
diff --git a/testsuite/md5sum.tests b/testsuite/md5sum.tests index 6c75b6d1c..cca26dc64 100755 --- a/testsuite/md5sum.tests +++ b/testsuite/md5sum.tests | |||
@@ -23,6 +23,8 @@ test -f "$bindir/.config" && . "$bindir/.config" | |||
23 | test x"$CONFIG_FEATURE_FANCY_HEAD" != x"y" \ | 23 | test x"$CONFIG_FEATURE_FANCY_HEAD" != x"y" \ |
24 | && { echo "SKIPPED: $sum"; exit 0; } | 24 | && { echo "SKIPPED: $sum"; exit 0; } |
25 | 25 | ||
26 | FAILCOUNT=0 | ||
27 | |||
26 | text="The quick brown fox jumps over the lazy dog" | 28 | text="The quick brown fox jumps over the lazy dog" |
27 | text=`yes "$text" | head -c 9999` | 29 | text=`yes "$text" | head -c 9999` |
28 | 30 | ||
@@ -33,11 +35,21 @@ while test $n -le 999; do | |||
33 | n=$(($n+1)) | 35 | n=$(($n+1)) |
34 | done | "$sum" | 36 | done | "$sum" |
35 | )` | 37 | )` |
36 | 38 | if test x"$result" != x"$expected -"; then | |
37 | if test x"$result" = x"$expected -"; then | 39 | echo "FAIL: $sum (r:$result exp:$expected)" |
40 | : $((FAILCOUNT++)) | ||
41 | else | ||
38 | echo "PASS: $sum" | 42 | echo "PASS: $sum" |
39 | exit 0 | ||
40 | fi | 43 | fi |
41 | 44 | ||
42 | echo "FAIL: $sum (r:$result exp:$expected)" | 45 | # GNU compat: -c EMPTY must fail (exitcode 1)! |
43 | exit 1 | 46 | >EMPTY |
47 | if "$sum" -c EMPTY 2>/dev/null; then | ||
48 | echo "FAIL: $sum -c EMPTY" | ||
49 | : $((FAILCOUNT++)) | ||
50 | else | ||
51 | echo "PASS: $sum -c EMPTY" | ||
52 | fi | ||
53 | rm EMPTY | ||
54 | |||
55 | exit $FAILCOUNT | ||
diff --git a/testsuite/sed.tests b/testsuite/sed.tests index a71f8b1f0..05c00a99b 100755 --- a/testsuite/sed.tests +++ b/testsuite/sed.tests | |||
@@ -73,13 +73,9 @@ testing "sed t (test/branch clears test bit)" "sed -e 's/a/b/;:loop;t loop'" \ | |||
73 | testing "sed T (!test/branch)" "sed -e 's/a/1/;T notone;p;: notone;p'" \ | 73 | testing "sed T (!test/branch)" "sed -e 's/a/1/;T notone;p;: notone;p'" \ |
74 | "1\n1\n1\nb\nb\nc\nc\n" "" "a\nb\nc\n" | 74 | "1\n1\n1\nb\nb\nc\nc\n" "" "a\nb\nc\n" |
75 | 75 | ||
76 | test x"$SKIP_KNOWN_BUGS" = x"" && { | ||
77 | # Normal sed end-of-script doesn't print "c" because n flushed the pattern | ||
78 | # space. If n hits EOF, pattern space is empty when script ends. | ||
79 | # Query: how does this interact with no newline at EOF? | ||
80 | testing "sed n (flushes pattern space, terminates early)" "sed -e 'n;p'" \ | 76 | testing "sed n (flushes pattern space, terminates early)" "sed -e 'n;p'" \ |
81 | "a\nb\nb\nc\n" "" "a\nb\nc\n" | 77 | "a\nb\nb\nc\n" "" "a\nb\nc\n" |
82 | } | 78 | |
83 | # non-GNU sed: N does _not_ flush pattern space, therefore c is eaten @ script end | 79 | # non-GNU sed: N does _not_ flush pattern space, therefore c is eaten @ script end |
84 | # GNU sed: N flushes pattern space, therefore c is printed too @ script end | 80 | # GNU sed: N flushes pattern space, therefore c is printed too @ script end |
85 | testing "sed N (flushes pattern space (GNU behavior))" "sed -e 'N;p'" \ | 81 | testing "sed N (flushes pattern space (GNU behavior))" "sed -e 'N;p'" \ |
diff --git a/testsuite/sha3sum.tests b/testsuite/sha3sum.tests index 82fada633..2cd8e3bf2 100755 --- a/testsuite/sha3sum.tests +++ b/testsuite/sha3sum.tests | |||
@@ -1,3 +1,3 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | . ./md5sum.tests sha3sum c29d77bc548fa2b20a04c861400a5360879c52156e2a54a3415b99a9a3123e1d5f36714a24eca8c1f05a8e2d8ba859c930d41141f64a255c6794436fc99c486a | 3 | . ./md5sum.tests sha3sum 11659f09370139f8ef384f4a6260947fafa6e4fcd87a1ef3f35410e9 |