4 use Test::More tests => 47;
8 use_ok('MooseX::Storage');
13 This test checks the single level
14 expansion and collpasing of the
15 ArrayRef and HashRef type handlers.
26 has 'number' => (is => 'ro', isa => 'Int');
53 bars => [ map { Bar->new(number => $_) } (1 .. 10) ]
55 isa_ok( $foo, 'Foo' );
70 '... got the right frozen class'
75 my $foo = Foo->unpack(
88 isa_ok( $foo, 'Foo' );
90 foreach my $i (1 .. scalar @{$foo->bars}) {
91 isa_ok($foo->bars->[$i - 1], 'Bar');
92 is($foo->bars->[$i - 1]->number, $i, "... got the right number ($i) in the Bar in Foo");
99 bars => { map { ($_ => Bar->new(number => $_)) } (1 .. 10) }
101 isa_ok( $baz, 'Baz' );
116 '... got the right frozen class'
121 my $baz = Baz->unpack(
134 isa_ok( $baz, 'Baz' );
136 foreach my $k (keys %{$baz->bars}) {
137 isa_ok($baz->bars->{$k}, 'Bar');
138 is($baz->bars->{$k}->number, $k, "... got the right number ($k) in the Bar in Baz");