6 use Test::More tests => 47;
10 use_ok('MooseX::Storage');
15 This test checks the single level
16 expansion and collpasing of the
17 ArrayRef and HashRef type handlers.
28 has 'number' => (is => 'ro', isa => 'Int');
55 bars => [ map { Bar->new(number => $_) } (1 .. 10) ]
57 isa_ok( $foo, 'Foo' );
72 '... got the right frozen class'
77 my $foo = Foo->unpack(
90 isa_ok( $foo, 'Foo' );
92 foreach my $i (1 .. scalar @{$foo->bars}) {
93 isa_ok($foo->bars->[$i - 1], 'Bar');
94 is($foo->bars->[$i - 1]->number, $i, "... got the right number ($i) in the Bar in Foo");
101 bars => { map { ($_ => Bar->new(number => $_)) } (1 .. 10) }
103 isa_ok( $baz, 'Baz' );
118 '... got the right frozen class'
123 my $baz = Baz->unpack(
136 isa_ok( $baz, 'Baz' );
138 foreach my $k (keys %{$baz->bars}) {
139 isa_ok($baz->bars->{$k}, 'Bar');
140 is($baz->bars->{$k}->number, $k, "... got the right number ($k) in the Bar in Baz");