Commit | Line | Data |
---|---|---|
096619f2 MG |
1 | #!/usr/bin/perl |
2 | use strict; | |
3 | use warnings; | |
4 | ||
fb44a513 MG |
5 | use Test::More tests => 7; |
6 | use Test::Exception; | |
7 | ||
096619f2 MG |
8 | BEGIN { use_ok('Digest::HighwayHash') }; |
9 | ||
2893b3c3 MG |
10 | is highway_hash64([1, 2, 3, 4], 'hello'), '11956820856122239241', 'highway_hash64'; |
11 | is_deeply highway_hash128([1, 2, 3, 4], 'hello'), ['3048112761216189476', '13900443277579286659'], 'highway_hash128'; | |
12 | is_deeply highway_hash256([1, 2, 3, 4], 'hello'), ['8099666330974151427', '17027479935588128037', '4015249936799013189', '10027181291351549853'], 'highway_hash256'; | |
fb44a513 MG |
13 | |
14 | throws_ok { highway_hash64 1, 'hello' } qr/not an ARRAY reference/, 'bad key 1'; | |
15 | throws_ok { highway_hash128 [1, 2], 'hello' } qr/Key for highway_hash must be a 4-element array/, 'bad key 2'; | |
16 | throws_ok { highway_hash256 [1, 2, 3, 4, 5], 'hello' } qr/Key for highway_hash must be a 4-element array/, 'bad key 3'; |