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 30 31 32
|
#!/usr/bin/perl
use strict;
use warnings;
use Test::More;
unless (eval { require Storable; 1}) {
plan skip_all => 'Storable not installed';
exit;
}
use Math::Int64 qw(int64_rand uint64_rand);
my $a = [map int64_rand, 0..99];
my $b = Storable::thaw(Storable::freeze($a));
for (0..$#$a) {
ok ($a->[$_] == $b->[$_]);
}
$a = [map uint64_rand, 0..99];
$b = Storable::thaw(Storable::freeze($a));
for (0..$#$a) {
ok ($a->[$_] == $b->[$_]);
}
done_testing();
|