Commit | Line | Data |
6bc89f92 |
1 | use Test; |
2 | use strict; |
3 | use integer; |
4 | use Digest::SHA qw(sha224_hex); |
5 | |
41c686de |
6 | BEGIN { |
77d2a621 |
7 | if ($ENV{PERL_CORE}) { |
8 | chdir 't' if -d 't'; |
9 | @INC = '../lib'; |
10 | } |
41c686de |
11 | } |
12 | |
6bc89f92 |
13 | my(@vec, @rsp); |
14 | |
77d2a621 |
15 | BEGIN { |
6bc89f92 |
16 | @vec = ( |
17 | "abc", |
18 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", |
19 | "a" x 1000000 |
20 | ); |
21 | |
22 | @rsp = ( |
23 | "23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7", |
24 | "75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525", |
25 | "20794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad67" |
26 | ); |
27 | |
77d2a621 |
28 | plan tests => scalar(@vec); |
6bc89f92 |
29 | } |
30 | |
31 | for (my $i = 0; $i < @vec; $i++) { |
32 | ok(sha224_hex($vec[$i]), $rsp[$i]); |
33 | } |