use ExtUtils::HasCompiler for compiler detection
[p5sagit/strictures.git] / t / extras.t
index b8c5ecf..474ad38 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,16 +90,17 @@ use strictures;
 
   {
     open my $fh, '>', \(my $str = '');
+    my $e;
     {
       local *STDERR = $fh;
       eval qq{
 #line 1 "t/load_fail.t"
 use strictures;
 1;
-      } or die "$@";
+      } or $e = "$@";
     }
+    die $e if defined $e;
 
-    strictures->import;
     like(
       $str,
       qr/Missing were:\n\n  indirect multidimensional bareword::filehandles/,
@@ -109,14 +110,16 @@ use strictures;
 
   {
     open my $fh, '>', \(my $str = '');
+    my $e;
     {
       local *STDERR = $fh;
       eval qq{
 #line 1 "t/load_fail.t"
 use strictures;
 1;
-      } or die "$@";
+      } or $e = "$@";
     }
+    die $e if defined $e;
 
     is $str, '', "extra dep load failure is not reported a second time";
   }