summaryrefslogtreecommitdiff
path: root/tests/md5sum
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-12-22 14:14:01 +0000
committerJim Meyering <jim@meyering.net>1996-12-22 14:14:01 +0000
commitc84fb64144c967ba2f32db83029f423fd7d10fad (patch)
tree844eaa1d8b3439f26f02e620a7889a3caaab2e61 /tests/md5sum
parent8e02fb10abc47c6880b45dfee305bedbad8a5ec2 (diff)
downloadcoreutils-c84fb64144c967ba2f32db83029f423fd7d10fad.tar.xz
.
Diffstat (limited to 'tests/md5sum')
-rw-r--r--tests/md5sum/Test.pm41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/md5sum/Test.pm b/tests/md5sum/Test.pm
new file mode 100644
index 000000000..3ebc7c13d
--- /dev/null
+++ b/tests/md5sum/Test.pm
@@ -0,0 +1,41 @@
+# -*-perl-*-
+package Test;
+require 5.002;
+use strict;
+
+$Test::input_via_stdin = 1;
+
+sub test_vector
+{
+ my @tvec =
+ (
+ # test-name options input expected-output expected-return-code
+ #
+ ['1', '', '', 'd41d8cd98f00b204e9800998ecf8427e', 0],
+ ['2', '', 'a', '0cc175b9c0f1b6a831c399e269772661', 0],
+ ['3', '', 'abc', '900150983cd24fb0d6963f7d28e17f72', 0],
+ ['4', '', 'message digest', 'f96b697d7cb7938d525a2f31aaf161d0', 0],
+ ['5', '', 'abcdefghijklmnopqrstuvwxyz',
+ 'c3fcd3d76192e4007dfb496cca67e13b', 0],
+ ['6', '',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
+ 'd174ab98d277d9f5a5611c2c9f419d9f', 0],
+ ['7', '', '1234567890123456789012345678901234567890'
+ . '1234567890123456789012345678901234567890',
+ '57edf4a22be3c955ac49da2e2107b67a', 0],
+ );
+ my @tv;
+
+ # Append two spaces, the input file name (-), and a newline to each
+ # expected output string.
+ my $t;
+ foreach $t (@tvec)
+ {
+ my ($test_name, $flags, $in, $exp, $ret) = @$t;
+ push (@tv, [$test_name, $flags, $in, "$exp -\n", $ret]);
+ }
+
+ return @tv;
+}
+
+1;