This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to CGI.pm-3.31. Includes version bump to CGI::Carp due to a Pod fix.
[perl5.git] / lib / Exporter.t
index c90a460..27b1e67 100644 (file)
@@ -1,12 +1,14 @@
-#!./perl -w
+#!perl -w
 
 BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
+   if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
 
 # Can't use Test::Simple/More, they depend on Exporter.
-my $test = 1;
+my $test;
 sub ok ($;$) {
     my($ok, $name) = @_;
 
@@ -21,9 +23,12 @@ sub ok ($;$) {
 }
 
 
-print "1..28\n";
-require Exporter;
-ok( 1, 'Exporter compiled' );
+BEGIN {
+    $test = 1;
+    print "1..28\n";
+    require Exporter;
+    ok( 1, 'Exporter compiled' );
+}
 
 
 BEGIN {
@@ -166,7 +171,7 @@ eval { Yet::More::Testing->require_version(10); 1 };
 
 my $warnings;
 BEGIN {
-    $SIG{__WARN__} = sub { $warnings = join '', @_ };
+    local $SIG{__WARN__} = sub { $warnings = join '', @_ };
     package Testing::Unused::Vars;
     @ISA = qw(Exporter);
     @EXPORT = qw(this $TODO that);
@@ -201,7 +206,6 @@ package The::Import;
 
 use Exporter 'import';
 
-eval { import() };
 ::ok(\&import == \&Exporter::import, "imported the import routine");
 
 @EXPORT = qw( wibble );