object => Foo->new( number => 2 ),
);
isa_ok( $foo, 'Foo' );
-
+
my $packed = $foo->pack;
-
+
cmp_deeply(
$packed,
{
float => 10.5,
array => [ 1 .. 10 ],
hash => { map { $_ => undef } ( 1 .. 10 ) },
- object => {
- __CLASS__ => 'Foo',
- __DIGEST__ => re('[0-9a-f]+'),
- number => 2
- },
+ object => {
+ __CLASS__ => 'Foo',
+ __DIGEST__ => re('[0-9a-f]+'),
+ number => 2
+ },
},
'... got the right frozen class'
);
$foo2 = Foo->unpack($packed);
}, undef, '... unpacked okay');
isa_ok($foo2, 'Foo');
-
+
cmp_deeply(
$foo2->pack,
{
float => 10.5,
array => [ 1 .. 10 ],
hash => { map { $_ => undef } ( 1 .. 10 ) },
- object => {
- __CLASS__ => 'Foo',
- __DIGEST__ => re('[0-9a-f]+'),
- number => 2
- },
+ object => {
+ __CLASS__ => 'Foo',
+ __DIGEST__ => re('[0-9a-f]+'),
+ number => 2
+ },
},
'... got the right frozen class'
- );
+ );
}
{