From: Hugo van der Sanden Date: Sun, 25 Aug 2002 19:03:50 +0000 (+0000) Subject: fix bignum test failures X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0772a4e5ebeb4d946aa2ef5ed4d54b8a567fca2e;p=p5sagit%2Fp5-mst-13.2.git fix bignum test failures p4raw-id: //depot/perl@17780 --- diff --git a/lib/bignum/t/biinfnan.t b/lib/bignum/t/biinfnan.t index 84d3a71..758bed1 100644 --- a/lib/bignum/t/biinfnan.t +++ b/lib/bignum/t/biinfnan.t @@ -8,8 +8,26 @@ use strict; BEGIN { $| = 1; - chdir 't' if -d 't'; - unshift @INC, '../lib'; + my $location = $0; $location =~ s{^(.*/).*}{$1}; + if ($ENV{PERL_CORE}) + { + @INC = qw(../lib); # testing with the core distribution + } + else + { + unshift @INC, '../lib'; # for testing manually + } + if (-d 't') + { + chdir 't'; + require File::Spec; + unshift @INC, File::Spec->catdir(File::Spec->updir, $location); + } + else + { + unshift @INC, $location; + } + print "# INC = @INC\n"; plan tests => 26; } diff --git a/lib/bignum/t/bninfnan.t b/lib/bignum/t/bninfnan.t index 9fac5bd..2b84406 100644 --- a/lib/bignum/t/bninfnan.t +++ b/lib/bignum/t/bninfnan.t @@ -8,7 +8,7 @@ use strict; BEGIN { $| = 1; - my $location = $0; $location =~ s/biinfnan.t//i; + my $location = $0; $location =~ s{^(.*/).*}{$1}; if ($ENV{PERL_CORE}) { @INC = qw(../lib); # testing with the core distribution diff --git a/lib/bignum/t/brinfnan.t b/lib/bignum/t/brinfnan.t index 689a855..266c51b 100644 --- a/lib/bignum/t/brinfnan.t +++ b/lib/bignum/t/brinfnan.t @@ -8,8 +8,26 @@ use strict; BEGIN { $| = 1; - chdir 't' if -d 't'; - unshift @INC, '../lib'; + my $location = $0; $location =~ s{^(.*/).*}{$1}; + if ($ENV{PERL_CORE}) + { + @INC = qw(../lib); # testing with the core distribution + } + else + { + unshift @INC, '../lib'; # for testing manually + } + if (-d 't') + { + chdir 't'; + require File::Spec; + unshift @INC, File::Spec->catdir(File::Spec->updir, $location); + } + else + { + unshift @INC, $location; + } + print "# INC = @INC\n"; plan tests => 26; }