File: storable.t

package info (click to toggle)
libmath-int64-perl 0.54-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 672 kB
  • ctags: 924
  • sloc: perl: 2,805; ansic: 320; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 479 bytes parent folder | download | duplicates (2)
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();