Test bug #111462, Safe + %^H + disallowed ops
authorFather Chrysostomos <sprout@cpan.org>
Sun, 24 Jun 2012 01:24:52 +0000 (18:24 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 29 Jun 2012 07:20:58 +0000 (00:20 -0700)
dist/Safe/t/safeops.t

index 8edb223..85dc945 100644 (file)
@@ -40,7 +40,7 @@ while (<$fh>) {
 }
 close $fh;
 
-plan(tests => scalar @op + 2);
+plan(tests => scalar @op + 3);
 
 sub testop {
     my ($op, $opname, $code) = @_;
@@ -81,6 +81,16 @@ foreach (@op) {
        ),
        qr/Unbalanced/,
        'No Unbalanced warnings when disallowing ops';
+    unlike
+       runperl(
+           switches => [ '-MSafe', '-w' ],
+           prog     => 'Safe->new->reval('
+                       . 'q(BEGIN{$^H{foo}=bar};use strict), 0'
+                       .')',
+           stderr   => 1,
+       ),
+       qr/Unbalanced/,
+       'No Unbalanced warnings when disallowing ops with %^H set';
 }
 
 # things that begin with SKIP are skipped, for various reasons (notably