1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#!/usr/bin/perl -d
use Test::More tests => 1;
# XXX: Code taken from namespace::clean's t/07--debugger.t
BEGIN
{
no warnings 'once';
# Apparently we can't just skip_all with -d, because the
# debugger breaks at Test::Testers END block.
if($] <= 5.010000)
{
pass;
done_testing;
}
else
{
push(@DB::typeahead, 'c');
}
push(@DB::typeahead, 'q');
open(my $out, '>', \my $out_buf) or warn "Could not open new out handle - $!";
$DB::OUT = $out;
open(my $in, '<', \my $in_buf) or warn "Could not open new in handle - $!";
$DB::IN = $in;
}
use FindBin qw($Bin);
use lib "$Bin/lib";
require Person1;
delete $INC{'Person1.pm'};
eval { require Person1 };
ok(!$@, 'double load');
done_testing;
|