Upgrade to Devel::PPPort 3.10_02
[p5sagit/p5-mst-13.2.git] / lib / Exporter.t
index 548613d..2fbfcfa 100644 (file)
@@ -1,8 +1,10 @@
-#!./perl
+#!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.
@@ -75,7 +77,7 @@ $seat     = 'seat';
 BEGIN {*is = \&Is};
 sub Is { 'Is' };
 
-Exporter::export_ok_tags;
+Exporter::export_ok_tags();
 
 my %tags     = map { $_ => 1 } map { @$_ } values %EXPORT_TAGS;
 my %exportok = map { $_ => 1 } @EXPORT_OK;
@@ -102,7 +104,7 @@ my $got = eval {&lifejacket};
 # Testing->import is called.
 ::ok( eval "defined &is",
       "Import a subroutine where exporter must create the typeglob" );
-my $got = eval "&is";
+$got = eval "&is";
 ::ok ( $@ eq "", 'check we can call the imported autoloaded subroutine')
   or chomp ($@), print STDERR "# \$\@ is $@\n";
 ::ok ( $got eq 'Is', 'and that it gave the correct result')
@@ -182,20 +184,20 @@ package Moving::Target;
 @ISA = qw(Exporter);
 @EXPORT_OK = qw (foo);
 
-sub foo {"foo"};
-sub bar {"bar"};
+sub foo {"This is foo"};
+sub bar {"This is bar"};
 
 package Moving::Target::Test;
 
-Moving::Target->import (foo);
+Moving::Target->import ('foo');
 
-::ok (foo eq "foo", "imported foo before EXPORT_OK changed");
+::ok (foo() eq "This is foo", "imported foo before EXPORT_OK changed");
 
 push @Moving::Target::EXPORT_OK, 'bar';
 
-Moving::Target->import (bar);
+Moving::Target->import ('bar');
 
-::ok (bar eq "bar", "imported bar after EXPORT_OK changed");
+::ok (bar() eq "This is bar", "imported bar after EXPORT_OK changed");
 
 package The::Import;