blob: f083bd3920ed4fd4c24b6baca216cc856d7af093 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
BEGIN {
if ($ENV{PERL_CORE}) {
chdir 't' if -d 't';
@INC = '../lib';
}
}
use strict;
use Digest::SHA qw(sha224_hex);
my @vecs = map { eval } <DATA>;
my $numtests = scalar(@vecs) / 2;
print "1..$numtests\n";
for (1 .. $numtests) {
my $data = shift @vecs;
my $digest = shift @vecs;
print "not " unless sha224_hex($data) eq $digest;
print "ok ", $_, "\n";
}
__DATA__
"abc"
"23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7"
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
"75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525"
"a" x 1000000
"20794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67"
|