author test for new warning categories
[p5sagit/strictures.git] / t / extras.t
index d314290..cef6a6c 100644 (file)
@@ -79,7 +79,7 @@ use strictures;
 
 {
   local $ENV{PERL_STRICTURES_EXTRA} = 1;
-  local $strictures::extra_load_states = undef;
+  local %strictures::extra_load_states = ();
   local @INC = (sub {
     die "Can't locate $_[1] in \@INC (...).\n"
       if $extras{$_[1]};
@@ -90,12 +90,14 @@ use strictures;
 
   {
     open my $fh, '>', \(my $str = '');
-    local *STDERR = $fh;
-    eval qq{
+    {
+      local *STDERR = $fh;
+      eval qq{
 #line 1 "t/load_fail.t"
 use strictures;
 1;
-    } or die "$@";
+      } or die "$@";
+    }
 
     strictures->import;
     like(
@@ -107,12 +109,15 @@ use strictures;
 
   {
     open my $fh, '>', \(my $str = '');
-    local *STDERR = $fh;
-    eval qq{
+    {
+      local *STDERR = $fh;
+      eval qq{
 #line 1 "t/load_fail.t"
 use strictures;
 1;
-    } or die "$@";
+      } or die "$@";
+    }
+
     is $str, '', "extra dep load failure is not reported a second time";
   }
 }