This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The T_BOOL_2 tests should have failed, rewrite and TODO
authorTony Cook <tony@develop-help.com>
Wed, 19 Dec 2012 06:29:55 +0000 (17:29 +1100)
committerTony Cook <tony@develop-help.com>
Wed, 19 Dec 2012 22:31:31 +0000 (09:31 +1100)
ext/XS-Typemap/t/Typemap.t

index de0bf6d..93c1979 100644 (file)
@@ -150,10 +150,14 @@ ok( ! T_BOOL(0) );
 ok( ! T_BOOL('') );
 ok( ! T_BOOL(undef) );
 
-ok( T_BOOL_2(52) );
-ok( ! T_BOOL_2(0) );
-ok( ! T_BOOL_2('') );
-ok( ! T_BOOL_2(undef) );
+{
+  # these attempt to modify a read-only value
+  local $TODO = "attempts to modify a read-only value should crash";
+  ok( !eval { T_BOOL_2(52); 1 } );
+  ok( !eval { T_BOOL_2(0); 1 } );
+  ok( !eval { T_BOOL_2(''); 1 } );
+  ok( !eval { T_BOOL_2(undef); 1 } );
+}
 
 # T_U_SHORT aka U16
 note("T_U_SHORT");