diff options
Diffstat (limited to 'testsuite/md5sum.tests')
-rwxr-xr-x | testsuite/md5sum.tests | 22 |
1 files changed, 17 insertions, 5 deletions
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 | ||