aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gzip/gzip-compression-levels5
-rwxr-xr-xtestsuite/md5sum.tests22
-rwxr-xr-xtestsuite/sed.tests6
-rwxr-xr-xtestsuite/sha3sum.tests2
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
3level1=$(busybox gzip -c -1 $(which busybox) | wc -c)
4level9=$(busybox gzip -c -9 $(which busybox) | wc -c)
5test $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"
23test x"$CONFIG_FEATURE_FANCY_HEAD" != x"y" \ 23test x"$CONFIG_FEATURE_FANCY_HEAD" != x"y" \
24&& { echo "SKIPPED: $sum"; exit 0; } 24&& { echo "SKIPPED: $sum"; exit 0; }
25 25
26FAILCOUNT=0
27
26text="The quick brown fox jumps over the lazy dog" 28text="The quick brown fox jumps over the lazy dog"
27text=`yes "$text" | head -c 9999` 29text=`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))
34done | "$sum" 36done | "$sum"
35)` 37)`
36 38if test x"$result" != x"$expected -"; then
37if test x"$result" = x"$expected -"; then 39 echo "FAIL: $sum (r:$result exp:$expected)"
40 : $((FAILCOUNT++))
41else
38 echo "PASS: $sum" 42 echo "PASS: $sum"
39 exit 0
40fi 43fi
41 44
42echo "FAIL: $sum (r:$result exp:$expected)" 45# GNU compat: -c EMPTY must fail (exitcode 1)!
43exit 1 46>EMPTY
47if "$sum" -c EMPTY 2>/dev/null; then
48 echo "FAIL: $sum -c EMPTY"
49 : $((FAILCOUNT++))
50else
51 echo "PASS: $sum -c EMPTY"
52fi
53rm EMPTY
54
55exit $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'" \
73testing "sed T (!test/branch)" "sed -e 's/a/1/;T notone;p;: notone;p'" \ 73testing "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
76test 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?
80testing "sed n (flushes pattern space, terminates early)" "sed -e 'n;p'" \ 76testing "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
85testing "sed N (flushes pattern space (GNU behavior))" "sed -e 'N;p'" \ 81testing "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