dist/base/t/fields-5_6_0.t See if fields work
dist/base/t/fields-5_8_0.t See if fields work
dist/base/t/fields-base.t See if fields work
-dist/base/t/incdot.t Test how base.pm handles '.' in @INC
dist/base/t/isa.t See if base's behaviour doesn't change
dist/base/t/lib/Broken.pm Test module for base.pm
dist/base/t/lib/Dummy.pm Test module for base.pm
{
local $SIG{__DIE__};
my $fn = _module_to_filename($base);
- local @INC = @INC;
- pop @INC if my $dotty = $INC[-1] eq '.';
- eval {
- require $fn
- };
+ eval { require $fn };
# Only ignore "Can't locate" errors from our eval require.
# Other fatal errors (syntax etc) must be reported.
#
unless (%{"$base\::"}) {
require Carp;
local $" = " ";
- my $e = <<ERROR;
+ Carp::croak(<<ERROR);
Base class package "$base" is empty.
(Perhaps you need to 'use' the module which defines that package first,
or make that module available in \@INC (\@INC contains: @INC).
ERROR
- if ($dotty && -e $fn) {
- $e .= <<ERROS;
- The file $fn does exist in the current directory. But note
- that base.pm, when loading a module, now ignores the current working
- directory if it is the last entry in \@INC. If your software worked on
- previous versions of Perl, the best solution is to use FindBin to
- detect the path properly and to add that path to \@INC. As a last
- resort, you can re-enable looking in the current working directory by
- adding "use lib '.'" to your code.
-ERROS
- }
- $e =~ s/\n\z/)\n/;
- Carp::croak($e);
}
$sigdie = $SIG{__DIE__} || undef;
}
+++ /dev/null
-#!/usr/bin/perl -w
-
-use strict;
-
-use base ();
-
-use Test::More tests => 2;
-
-if ($INC[-1] ne '.') { push @INC, '.' }
-
-my $inc = quotemeta "@INC[0..$#INC-1]";
-
-eval { 'base'->import("foo") };
-like $@, qr/\@INC contains: $inc\).\)/,
- 'Error does not list final dot in @INC (or mention use lib)';
-eval { 'base'->import('t::lib::Dummy') };
-like $@, qr<\@INC contains: $inc\).\n(?x:
- ) The file t/lib/Dummy\.pm does exist in the current direct>,
- 'special cur dir message for existing files in . that are ignored';