]> git.vpit.fr Git - perl/modules/Test-Leaner.git/blobdiff - lib/Test/Leaner.pm
Croak when importing symbols from Test::More that aren't in Test::Leaner
[perl/modules/Test-Leaner.git] / lib / Test / Leaner.pm
index 8e45f3c8bfe9d4a24266ffeea5b68c78d5263eac..f43be92145f520bd3ea16c3251c2c161d0d352e7 100644 (file)
@@ -182,7 +182,7 @@ if ($ENV{PERL_TEST_LEANER_USES_TEST_MORE}) {
  }
 
  my $import = sub {
-  shift;
+  my $class = shift;
 
   my @imports = &_handle_import_args;
   @imports    = @EXPORT unless @imports;
@@ -192,8 +192,11 @@ if ($ENV{PERL_TEST_LEANER_USES_TEST_MORE}) {
     my $pkg = caller;
     no strict 'refs';
     *{$pkg."::$_"} = $leaner_stash->{$_};
-   } else {
+   } elsif (/^!/ or !exists $more_stash->{$_} or exists $leaner_stash->{$_}) {
     push @test_more_imports, $_;
+   } else {
+    # Croak for symbols in Test::More but not in Test::Leaner
+    Exporter::import($class, $_);
    }
   }