blob: 741ec62fb9185f921d1577741e993d6bc99b73e2 [file] [log] [blame]
Rob Landley4d904aa2012-11-28 22:56:16 -06001#!/bin/bash
2
3[ -f testing.sh ] && . testing.sh
4
5#testing "name" "command" "result" "infile" "stdin"
6
7# These tests are from RFC 1321 appendix 5, reshuffled slightly to test
8# varying argument numbers
9
10testing "md5sum ''" "md5sum" "d41d8cd98f00b204e9800998ecf8427e -\n" "" ""
11testing "md5sum infile" "md5sum input" \
12 "0cc175b9c0f1b6a831c399e269772661 input\n" "a" ""
13testing "md5sum two files" "md5sum - input" \
14 "900150983cd24fb0d6963f7d28e17f72 -\nf96b697d7cb7938d525a2f31aaf161d0 input\n" \
15 "message digest" "abc"
16testing "md5sum 4" "md5sum" "c3fcd3d76192e4007dfb496cca67e13b -\n" \
17 "" "abcdefghijklmnopqrstuvwxyz"
18testing "md5sum 5" "md5sum" "d174ab98d277d9f5a5611c2c9f419d9f -\n" \
19 "" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
20testing "md5sum 6" "md5sum" "57edf4a22be3c955ac49da2e2107b67a -\n" \
21 "" "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
22