From: Dave Rolsky Date: Thu, 16 Jun 2011 15:35:14 +0000 (-0500) Subject: Add some tests for array traits to make sure it doesn't have the same accessor method... X-Git-Tag: 2.0008~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=43806a0aecda98f7f6b2f0b4ca3a87d23d5c8795;p=gitmo%2FMoose.git Add some tests for array traits to make sure it doesn't have the same accessor method bug that hash traits had --- diff --git a/t/native_traits/trait_array.t b/t/native_traits/trait_array.t index decf151..5e039fe 100644 --- a/t/native_traits/trait_array.t +++ b/t/native_traits/trait_array.t @@ -669,4 +669,22 @@ sub run_tests { $class; } +{ + my ( $class, $handles ) = build_class( isa => 'ArrayRef' ); + my $obj = $class->new; + with_immutable { + is( + exception { $obj->accessor( 0, undef ) }, + undef, + 'can use accessor to set value to undef' + ); + is( + exception { $obj->accessor_curried_1(undef) }, + undef, + 'can use curried accessor to set value to undef' + ); + } + $class; +} + done_testing;