6 use Test::More tests => 47;
9 use_ok('MooseX::Storage');
14 This test checks the single level
15 expansion and collpasing of the
16 ArrayRef and HashRef type handlers.
27 has 'number' => (is => 'ro', isa => 'Int');
54 bars => [ map { Bar->new(number => $_) } (1 .. 10) ]
56 isa_ok( $foo, 'Foo' );
71 '... got the right frozen class'
76 my $foo = Foo->unpack(
89 isa_ok( $foo, 'Foo' );
91 foreach my $i (1 .. scalar @{$foo->bars}) {
92 isa_ok($foo->bars->[$i - 1], 'Bar');
93 is($foo->bars->[$i - 1]->number, $i, "... got the right number ($i) in the Bar in Foo");
100 bars => { map { ($_ => Bar->new(number => $_)) } (1 .. 10) }
102 isa_ok( $baz, 'Baz' );
117 '... got the right frozen class'
122 my $baz = Baz->unpack(
135 isa_ok( $baz, 'Baz' );
137 foreach my $k (keys %{$baz->bars}) {
138 isa_ok($baz->bars->{$k}, 'Bar');
139 is($baz->bars->{$k}->number, $k, "... got the right number ($k) in the Bar in Baz");