Test NUL bytes with B::cstring() and B::perlstring().
authorNicholas Clark <nick@ccl4.org>
Sun, 24 Oct 2010 11:49:12 +0000 (13:49 +0200)
committerNicholas Clark <nick@ccl4.org>
Sun, 24 Oct 2010 11:50:07 +0000 (13:50 +0200)
ext/B/t/b.t

index 7691e97..a9fdbd6 100644 (file)
@@ -162,7 +162,8 @@ like(B::hash("wibble"), qr/0x[0-9a-f]*/, "Testing B::hash()");
     is(B::perlstring(undef), '0', "Testing B::perlstring(undef)");
 
     my @common = map {eval $_, $_}
-       '"wibble"', '"\""', '"\'"', '"\\\\"', '"\\n\\r\\t\\b\\a\\f"', '"\\177"';
+       '"wibble"', '"\""', '"\'"', '"\\\\"', '"\\n\\r\\t\\b\\a\\f"', '"\\177"',
+           '"\000"', '"\000\000"', '"\000Bing\000"';
 
     my $oct = sprintf "\\%03o", ord '?';
     my @tests = (@common, '$_', '"$_"', '@_', '"@_"', '??N', qq{"$oct?N"},