-#!./perl
+#!./perl -w
BEGIN {
chdir 't' if -d 't';
}
-print "1..24\n";
+print "1..28\n";
require Exporter;
ok( 1, 'Exporter compiled' );
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;
# 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')
::ok( !$warnings, 'Unused variables can be exported without warning' ) ||
print "# $warnings\n";
+package Moving::Target;
+@ISA = qw(Exporter);
+@EXPORT_OK = qw (foo);
+
+sub foo {"This is foo"};
+sub bar {"This is bar"};
+
+package Moving::Target::Test;
+
+Moving::Target->import ('foo');
+
+::ok (foo() eq "This is foo", "imported foo before EXPORT_OK changed");
+
+push @Moving::Target::EXPORT_OK, 'bar';
+
+Moving::Target->import ('bar');
+
+::ok (bar() eq "This is bar", "imported bar after EXPORT_OK changed");
+
+package The::Import;
+
+use Exporter 'import';
+
+eval { import() };
+::ok(\&import == \&Exporter::import, "imported the import routine");
+
+@EXPORT = qw( wibble );
+sub wibble {return "wobble"};
+
+package Use::The::Import;
+
+The::Import->import;
+
+my $val = eval { wibble() };
+::ok($val eq "wobble", "exported importer worked");
+