4 use Test::More tests => 13;
27 } qr/auto_deref without defaults don't explode on new/;
29 my ($array, @array, $hash, %hash);
38 } qr/auto_deref without default doesn't explode on get/;
40 is($obj->array, undef, "array without value is undef in scalar context");
41 is($obj->hash, undef, "hash without value is undef in scalar context");
43 is(@array, 0, "array without value is empty in list context");
44 is(keys %hash, 0, "hash without value is empty in list context");
46 @array = $obj->array([1, 2, 3]);
47 %hash = $obj->hash({foo => 1, bar => 2});
49 is_deeply(\@array, [1, 2, 3], "setter returns the dereferenced list");
50 is_deeply(\%hash, {foo => 1, bar => 2}, "setter returns the dereferenced hash");
60 } qr/auto_deref without default doesn't explode on get/;
62 is_deeply($array, [1, 2, 3], "auto_deref in scalar context gives the reference");
63 is_deeply($hash, {foo => 1, bar => 2}, "auto_deref in scalar context gives the reference");
65 is_deeply(\@array, [1, 2, 3], "auto_deref in list context gives the list");
66 is_deeply(\%hash, {foo => 1, bar => 2}, "auto_deref in list context gives the hash");