This works (under strict/warnings with no warning output)
my $x;
push @{$x}, 1;
my $foo = Foo->new;
{
- dies_ok { $foo->push_array('foo') } "array - can't push onto undef";
-
$foo->array( [] );
is_deeply( $foo->array, [], "array - correct contents" );
}
{
- dies_ok { $foo->push_array_int(1) } "array_int - can't push onto undef";
-
$foo->array_int( [] );
is_deeply( $foo->array_int, [], "array_int - correct contents" );