Commit | Line | Data |
6bc89f92 |
1 | use Test; |
2 | use strict; |
3 | use integer; |
4 | use Digest::SHA qw(sha256_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 | "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad", |
24 | "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1", |
25 | "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0" |
26 | ); |
27 | |
28 | plan tests => scalar(@vec); |
29 | } |
30 | |
31 | for (my $i = 0; $i < @vec; $i++) { |
32 | ok(sha256_hex($vec[$i]), $rsp[$i]); |
33 | } |