}
-print "1..19\n";
+print "1..26\n";
require Exporter;
ok( 1, 'Exporter compiled' );
That => [qw(Above the @wailing)],
tray => [qw(Fasten $seatbelt)],
);
-@EXPORT = qw(lifejacket);
+@EXPORT = qw(lifejacket is);
@EXPORT_OK = qw(under &your $seat);
$VERSION = '1.05';
@wailing = qw(AHHHHHH);
%left = ( left => "right" );
+BEGIN {*is = \&Is};
+sub Is { 'Is' };
Exporter::export_ok_tags;
::ok( defined &lifejacket, 'simple import' );
+my $got = eval {&lifejacket};
+::ok ( $@ eq "", 'check we can call the imported subroutine')
+ or print STDERR "# \$\@ is $@\n";
+::ok ( $got eq 'lifejacket', 'and that it gave the correct result')
+ or print STDERR "# expected 'lifejacket', got " .
+ (defined $got ? "'$got'" : "undef") . "\n";
+
+# The string eval is important. It stops $Foo::{is} existing when
+# Testing->import is called.
+::ok( eval "defined &is",
+ "Import a subroutine where exporter must create the typeglob" );
+my $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')
+ or print STDERR "# expected 'Is', got " .
+ (defined $got ? "'$got'" : "undef") . "\n";
+
package Bar;
my @imports = qw($seatbelt &Above stuff @wailing %left);
::ok( !$warnings, 'Unused variables can be exported without warning' ) ||
print "# $warnings\n";
+package Moving::Target;
+@ISA = qw(Exporter);
+@EXPORT_OK = qw (foo);
+
+sub foo {"foo"};
+sub bar {"bar"};
+
+package Moving::Target::Test;
+
+Moving::Target->import (foo);
+
+::ok (foo eq "foo", "imported foo before EXPORT_OK changed");
+
+push @Moving::Target::EXPORT_OK, 'bar';
+
+Moving::Target->import (bar);
+
+::ok (bar eq "bar", "imported bar after EXPORT_OK changed");