Last change
on this file since 4032 was
2573,
checked in by Sam Hocevar, 13 years ago
|
- Factored the test suite to avoid excessive code duplication.
|
-
Property svn:executable set to
*
|
File size:
547 bytes
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | . "$(dirname "$0")/functions.inc" |
---|
4 | |
---|
5 | checkmd5() |
---|
6 | { |
---|
7 | CMD="$1" |
---|
8 | REFMD5="$2" |
---|
9 | printf " $(echo "$CMD .............................." | cut -b1-30) " |
---|
10 | MD5="$(eval "$CMD | $ZZUF -m -r0" 2>/dev/null | cut -f2 -d' ')" |
---|
11 | if [ "$MD5" != "$REFMD5" ]; then |
---|
12 | fail_test "$MD5 FAILED" |
---|
13 | else |
---|
14 | pass_test 'ok' |
---|
15 | fi |
---|
16 | } |
---|
17 | |
---|
18 | start_test "zzuf MD5 test" |
---|
19 | |
---|
20 | checkmd5 "printf ''" d41d8cd98f00b204e9800998ecf8427e |
---|
21 | checkmd5 echo 68b329da9893e34099c7d8ad5cb9c940 |
---|
22 | checkmd5 "printf 'hello world'" 5eb63bbbe01eeed093cb22bb8f5acdc3 |
---|
23 | |
---|
24 | stop_test |
---|
25 | |
---|
Note: See
TracBrowser
for help on using the repository browser.