source: zzuf/trunk/test/check-md5 @ 2573

Last change on this file since 2573 was 2573, checked in by sam, 6 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
5checkmd5()
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
18start_test "zzuf MD5 test"
19
20checkmd5 "printf ''" d41d8cd98f00b204e9800998ecf8427e
21checkmd5 echo 68b329da9893e34099c7d8ad5cb9c940
22checkmd5 "printf 'hello world'" 5eb63bbbe01eeed093cb22bb8f5acdc3
23
24stop_test
25
Note: See TracBrowser for help on using the repository browser.