Add some tests for array traits to make sure it doesn't have the same accessor method...
Dave Rolsky [Thu, 16 Jun 2011 15:35:14 +0000 (10:35 -0500)]
t/native_traits/trait_array.t

index f44d0b1..086b143 100644 (file)
@@ -697,4 +697,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;