-#!./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) = @_;
}
-print "1..28\n";
-require Exporter;
-ok( 1, 'Exporter compiled' );
+BEGIN {
+ $test = 1;
+ print "1..30\n";
+ require Exporter;
+ ok( 1, 'Exporter compiled' );
+}
BEGIN {
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);
use Exporter 'import';
-eval { import() };
::ok(\&import == \&Exporter::import, "imported the import routine");
@EXPORT = qw( wibble );
my $val = eval { wibble() };
::ok($val eq "wobble", "exported importer worked");
+# Check that Carp recognizes Exporter as internal to Perl
+require Carp;
+eval { Carp::croak() };
+::ok($Carp::Internal{Exporter}, "Carp recognizes Exporter");
+::ok($Carp::Internal{'Exporter::Heavy'}, "Carp recognizes Exporter::Heavy");
+