summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
Diffstat (limited to 'dist')
-rw-r--r--dist/Math-BigInt/t/_e_math.t23
-rw-r--r--dist/Math-BigInt/t/bare_mbf.t20
-rw-r--r--dist/Math-BigInt/t/bare_mbi.t20
-rw-r--r--dist/Math-BigInt/t/bare_mif.t20
-rw-r--r--dist/Math-BigInt/t/big_pi_e.t23
-rw-r--r--dist/Math-BigInt/t/bigfltpm.t18
-rw-r--r--dist/Math-BigInt/t/bigintc.t8
-rw-r--r--dist/Math-BigInt/t/bigintpm.t7
-rw-r--r--dist/Math-BigInt/t/bigints.t21
-rw-r--r--dist/Math-BigInt/t/biglog.t23
-rw-r--r--dist/Math-BigInt/t/bigroot.t23
-rw-r--r--dist/Math-BigInt/t/calling.t16
-rw-r--r--dist/Math-BigInt/t/config.t10
-rw-r--r--dist/Math-BigInt/t/const_mbf.t16
-rw-r--r--dist/Math-BigInt/t/constant.t16
-rw-r--r--dist/Math-BigInt/t/downgrade.t5
-rw-r--r--dist/Math-BigInt/t/inf_nan.t26
-rw-r--r--dist/Math-BigInt/t/isa.t17
-rw-r--r--dist/Math-BigInt/t/lib_load.t23
-rw-r--r--dist/Math-BigInt/t/mbf_ali.t27
-rw-r--r--dist/Math-BigInt/t/mbi_ali.t27
-rw-r--r--dist/Math-BigInt/t/mbi_rand.t17
-rw-r--r--dist/Math-BigInt/t/mbimbf.t18
-rw-r--r--dist/Math-BigInt/t/nan_cmp.t10
-rw-r--r--dist/Math-BigInt/t/req_mbf0.t23
-rw-r--r--dist/Math-BigInt/t/req_mbf1.t16
-rw-r--r--dist/Math-BigInt/t/req_mbfa.t16
-rw-r--r--dist/Math-BigInt/t/req_mbfi.t16
-rw-r--r--dist/Math-BigInt/t/req_mbfn.t16
-rw-r--r--dist/Math-BigInt/t/req_mbfw.t25
-rw-r--r--dist/Math-BigInt/t/require.t16
-rw-r--r--dist/Math-BigInt/t/round.t23
-rw-r--r--dist/Math-BigInt/t/sub_ali.t26
-rw-r--r--dist/Math-BigInt/t/sub_mbf.t19
-rw-r--r--dist/Math-BigInt/t/sub_mbi.t19
-rw-r--r--dist/Math-BigInt/t/sub_mif.t19
-rw-r--r--dist/Math-BigInt/t/trap.t10
-rw-r--r--dist/Math-BigInt/t/upgrade.t18
-rw-r--r--dist/Math-BigInt/t/upgradef.t16
-rw-r--r--dist/Math-BigInt/t/use.t16
-rw-r--r--dist/Math-BigInt/t/use_lib1.t17
-rw-r--r--dist/Math-BigInt/t/use_lib2.t17
-rw-r--r--dist/Math-BigInt/t/use_lib3.t17
-rw-r--r--dist/Math-BigInt/t/use_lib4.t17
-rw-r--r--dist/Math-BigInt/t/use_mbfw.t17
-rw-r--r--dist/Math-BigInt/t/with_sub.t19
46 files changed, 56 insertions, 776 deletions
diff --git a/dist/Math-BigInt/t/_e_math.t b/dist/Math-BigInt/t/_e_math.t
index 013985b064..bae9e2df09 100644
--- a/dist/Math-BigInt/t/_e_math.t
+++ b/dist/Math-BigInt/t/_e_math.t
@@ -2,29 +2,8 @@
# test the helper math routines in Math::BigFloat
-use Test::More;
use strict;
-
-BEGIN
- {
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/_e_math.t//i;
- unshift @INC, '../lib';
- 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;
- }
+use Test::More tests => 26;
use Math::BigFloat lib => 'Calc';
diff --git a/dist/Math-BigInt/t/bare_mbf.t b/dist/Math-BigInt/t/bare_mbf.t
index d5c186045c..96e041a4c7 100644
--- a/dist/Math-BigInt/t/bare_mbf.t
+++ b/dist/Math-BigInt/t/bare_mbf.t
@@ -5,23 +5,7 @@ use strict;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/bare_mbf.t//i;
- print "# $0\n";
- unshift @INC, '../lib';
- 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";
-
+ unshift @INC, 't';
plan tests => 2316;
}
@@ -31,4 +15,4 @@ use vars qw ($class $try $x $y $f @args $ans $ans1 $ans1_str $setup $CL);
$class = "Math::BigFloat";
$CL = "Math::BigInt::BareCalc";
-require 'bigfltpm.inc'; # all tests here for sharing
+require 't/bigfltpm.inc'; # all tests here for sharing
diff --git a/dist/Math-BigInt/t/bare_mbi.t b/dist/Math-BigInt/t/bare_mbi.t
index 0a5d7314c7..849e5989b8 100644
--- a/dist/Math-BigInt/t/bare_mbi.t
+++ b/dist/Math-BigInt/t/bare_mbi.t
@@ -5,22 +5,7 @@ use strict;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/bare_mbi.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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";
-
+ unshift @INC, 't';
plan tests => 3279;
}
@@ -34,5 +19,4 @@ $CL = "Math::BigInt::BareCalc";
my $version = '1.84'; # for $VERSION tests, match current release (by hand!)
-require 'bigintpm.inc'; # perform same tests as bigintpm
-
+require 't/bigintpm.inc'; # perform same tests as bigintpm
diff --git a/dist/Math-BigInt/t/bare_mif.t b/dist/Math-BigInt/t/bare_mif.t
index c508e10450..43407124c9 100644
--- a/dist/Math-BigInt/t/bare_mif.t
+++ b/dist/Math-BigInt/t/bare_mif.t
@@ -8,22 +8,7 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/bare_mif.t//i;
- 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";
-
+ unshift @INC, 't';
plan tests => 684
+ 1; # our own tests
}
@@ -40,5 +25,4 @@ $mbf = 'Math::BigFloat';
ok (Math::BigInt->config()->{lib},'Math::BigInt::BareCalc');
-require 'mbimbf.inc';
-
+require 't/mbimbf.inc';
diff --git a/dist/Math-BigInt/t/big_pi_e.t b/dist/Math-BigInt/t/big_pi_e.t
index 1e3d08f6c1..9cc4751aa4 100644
--- a/dist/Math-BigInt/t/big_pi_e.t
+++ b/dist/Math-BigInt/t/big_pi_e.t
@@ -2,29 +2,8 @@
# Test bpi() and bexp()
-use Test::More;
use strict;
-
-BEGIN
- {
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/big_pi_e.t//i;
- unshift @INC, '../lib';
- 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 => 8;
- }
+use Test::More tests => 8;
use Math::BigFloat;
diff --git a/dist/Math-BigInt/t/bigfltpm.t b/dist/Math-BigInt/t/bigfltpm.t
index dbd36ac90a..43807635e1 100644
--- a/dist/Math-BigInt/t/bigfltpm.t
+++ b/dist/Math-BigInt/t/bigfltpm.t
@@ -5,22 +5,6 @@ use strict;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/bigfltpm.t//i;
- unshift @INC, '../lib';
- 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 => 2316
+ 5; # own tests
}
@@ -46,4 +30,4 @@ my $e = $c->bdiv(Math::BigFloat->new(3),$d);
ok ($e,'0.00267'); # '0.008 / 3 => 0.0027');
ok (ref($e->{_e}->[0]), ''); # 'Not a BigInt');
-require 'bigfltpm.inc'; # all tests here for sharing
+require 't/bigfltpm.inc'; # all tests here for sharing
diff --git a/dist/Math-BigInt/t/bigintc.t b/dist/Math-BigInt/t/bigintc.t
index 5dbace06a3..763cb79ec4 100644
--- a/dist/Math-BigInt/t/bigintc.t
+++ b/dist/Math-BigInt/t/bigintc.t
@@ -5,14 +5,6 @@ use Test;
BEGIN
{
- $| = 1;
- chdir 't' if -d 't';
- unshift @INC, '../lib'; # for running manually
- if ($^O eq 'unicos') # the tests hang under "unicos"
- {
- print "1..0\n";
- exit(0);
- }
plan tests => 375;
}
diff --git a/dist/Math-BigInt/t/bigintpm.t b/dist/Math-BigInt/t/bigintpm.t
index 4f33c9f905..1ec62e35af 100644
--- a/dist/Math-BigInt/t/bigintpm.t
+++ b/dist/Math-BigInt/t/bigintpm.t
@@ -5,11 +5,6 @@ use strict;
BEGIN
{
- $| = 1;
- unshift @INC, '../lib'; # for running manually
- my $location = $0; $location =~ s/bigintpm.t//;
- unshift @INC, $location; # to locate the testing files
- chdir 't' if -d 't';
plan tests => 3279 + 6;
}
@@ -43,4 +38,4 @@ ok ($x, "9903520314281112085086151826", 'from_oct() works with big numbers');
#############################################################################
# all the other tests
-require 'bigintpm.inc'; # all tests here for sharing
+require 't/bigintpm.inc'; # all tests here for sharing
diff --git a/dist/Math-BigInt/t/bigints.t b/dist/Math-BigInt/t/bigints.t
index de073e21e5..aab776c396 100644
--- a/dist/Math-BigInt/t/bigints.t
+++ b/dist/Math-BigInt/t/bigints.t
@@ -5,26 +5,7 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/bigints.t//i;
- if ($ENV{PERL_CORE})
- {
- @INC = qw(../t/lib); # testing with the core distribution
- }
- 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";
-
+ unshift @INC, 't';
plan tests => 51;
}
diff --git a/dist/Math-BigInt/t/biglog.t b/dist/Math-BigInt/t/biglog.t
index a2a04767f5..a36dad03e2 100644
--- a/dist/Math-BigInt/t/biglog.t
+++ b/dist/Math-BigInt/t/biglog.t
@@ -11,29 +11,8 @@
# it at all (which did lead to wrong answers for 0 < $x < 1 in blog() in
# versions up to v1.63, and for bsqrt($x) when $x << 1 for instance).
-use Test::More;
use strict;
-
-BEGIN
- {
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/biglog.t//i;
- unshift @INC, '../lib';
- 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 => 70;
- }
+use Test::More tests => 70;
use Math::BigFloat;
use Math::BigInt;
diff --git a/dist/Math-BigInt/t/bigroot.t b/dist/Math-BigInt/t/bigroot.t
index 11d99d2dca..c90d5ae9af 100644
--- a/dist/Math-BigInt/t/bigroot.t
+++ b/dist/Math-BigInt/t/bigroot.t
@@ -8,29 +8,8 @@
# But it is better to test the numerical functionality, instead of not testing
# it at all.
-use Test::More;
use strict;
-
-BEGIN
- {
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/bigroot.t//i;
- unshift @INC, '../lib';
- 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 => 4 * 2;
- }
+use Test::More tests => 4 * 2;
use Math::BigFloat;
use Math::BigInt;
diff --git a/dist/Math-BigInt/t/calling.t b/dist/Math-BigInt/t/calling.t
index 30a9862a0e..e6987aa62d 100644
--- a/dist/Math-BigInt/t/calling.t
+++ b/dist/Math-BigInt/t/calling.t
@@ -7,21 +7,7 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/calling.t//i;
- unshift @INC, '../lib';
- 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";
+ unshift @INC, 't';
my $tests = 160;
plan tests => $tests;
}
diff --git a/dist/Math-BigInt/t/config.t b/dist/Math-BigInt/t/config.t
index 3bc9d2efee..2d079b99ec 100644
--- a/dist/Math-BigInt/t/config.t
+++ b/dist/Math-BigInt/t/config.t
@@ -1,15 +1,7 @@
#!/usr/bin/perl -w
use strict;
-use Test::More;
-
-BEGIN
- {
- $| = 1;
- chdir 't' if -d 't';
- unshift @INC, '../lib'; # for running manually
- plan tests => 55;
- }
+use Test::More tests => 55;
# test whether Math::BigInt->config() and Math::BigFloat->config() works
diff --git a/dist/Math-BigInt/t/const_mbf.t b/dist/Math-BigInt/t/const_mbf.t
index aa6f9651c1..a03d00bdf2 100644
--- a/dist/Math-BigInt/t/const_mbf.t
+++ b/dist/Math-BigInt/t/const_mbf.t
@@ -7,22 +7,6 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/const_mbf.t//i;
- unshift @INC, qw(../lib);
- 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 => 2;
}
diff --git a/dist/Math-BigInt/t/constant.t b/dist/Math-BigInt/t/constant.t
index e39312e8dd..094e3005dc 100644
--- a/dist/Math-BigInt/t/constant.t
+++ b/dist/Math-BigInt/t/constant.t
@@ -5,22 +5,6 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/constant.t//i;
- unshift @INC, qw(../lib);
- 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 => 7;
}
diff --git a/dist/Math-BigInt/t/downgrade.t b/dist/Math-BigInt/t/downgrade.t
index 25d672c50f..371d87c4fa 100644
--- a/dist/Math-BigInt/t/downgrade.t
+++ b/dist/Math-BigInt/t/downgrade.t
@@ -5,11 +5,6 @@ use strict;
BEGIN
{
- $| = 1;
- unshift @INC, '../lib'; # for running manually
- my $location = $0; $location =~ s/downgrade.t//;
- unshift @INC, $location; # to locate the testing files
- chdir 't' if -d 't';
plan tests => 15;
}
diff --git a/dist/Math-BigInt/t/inf_nan.t b/dist/Math-BigInt/t/inf_nan.t
index 9a4cd240ee..f228cff73f 100644
--- a/dist/Math-BigInt/t/inf_nan.t
+++ b/dist/Math-BigInt/t/inf_nan.t
@@ -3,33 +3,15 @@
# test inf/NaN handling all in one place
# Thanx to Jarkko for the excellent explanations and the tables
-use Test::More;
use strict;
-BEGIN
- {
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/inf_nan.t//i;
- 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";
-
- # values groups operators classes tests
- plan tests => 7 * 6 * 5 * 4 * 2 +
+use Test::More
+ tests => 7 * 6 * 5 * 4 * 2 +
7 * 6 * 2 * 4 * 1 # bmod
;
# see bottom: + 4 * 10; # 4 classes * 10 NaN == NaN tests
- }
+
+BEGIN { unshift @INC, 't'; }
use Math::BigInt;
use Math::BigFloat;
diff --git a/dist/Math-BigInt/t/isa.t b/dist/Math-BigInt/t/isa.t
index 3c8aed5e37..9d7e824a16 100644
--- a/dist/Math-BigInt/t/isa.t
+++ b/dist/Math-BigInt/t/isa.t
@@ -5,22 +5,7 @@ use strict;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/isa.t//i;
- unshift @INC, qw(../lib);
- 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";
-
+ unshift @INC, 't';
plan tests => 7;
}
diff --git a/dist/Math-BigInt/t/lib_load.t b/dist/Math-BigInt/t/lib_load.t
index ab3cf2a95e..65a913ac35 100644
--- a/dist/Math-BigInt/t/lib_load.t
+++ b/dist/Math-BigInt/t/lib_load.t
@@ -1,28 +1,9 @@
#!/usr/bin/perl -w
-use Test::More;
use strict;
+use Test::More tests => 4;
-BEGIN
- {
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/sub_mbf.t//i;
- unshift @INC, '../lib';
- 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 => 4;
- }
+BEGIN { unshift @INC, 't'; }
# first load BigInt with Calc
use Math::BigInt lib => 'Calc';
diff --git a/dist/Math-BigInt/t/mbf_ali.t b/dist/Math-BigInt/t/mbf_ali.t
index 71e4b1383a..845fbe94e1 100644
--- a/dist/Math-BigInt/t/mbf_ali.t
+++ b/dist/Math-BigInt/t/mbf_ali.t
@@ -2,29 +2,8 @@
# test that the new alias names work
-use Test::More;
use strict;
-
-BEGIN
- {
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/mbf_ali.t//i;
- unshift @INC, qw(../lib);
- 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 => 6;
- }
+use Test::More tests => 6;
use Math::BigFloat;
@@ -32,6 +11,4 @@ use vars qw/$x $CL/;
$CL = 'Math::BigFloat';
-require 'alias.inc';
-
-
+require 't/alias.inc';
diff --git a/dist/Math-BigInt/t/mbi_ali.t b/dist/Math-BigInt/t/mbi_ali.t
index 921d16fc5f..d52812bec9 100644
--- a/dist/Math-BigInt/t/mbi_ali.t
+++ b/dist/Math-BigInt/t/mbi_ali.t
@@ -2,29 +2,8 @@
# test that the new alias names work
-use Test::More;
use strict;
-
-BEGIN
- {
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/mbi_ali.t//i;
- unshift @INC, qw(../lib);
- 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 => 6;
- }
+use Test::More tests => 6;
use Math::BigInt;
@@ -32,6 +11,4 @@ use vars qw/$x $CL/;
$CL = 'Math::BigInt';
-require 'alias.inc';
-
-
+require 't/alias.inc';
diff --git a/dist/Math-BigInt/t/mbi_rand.t b/dist/Math-BigInt/t/mbi_rand.t
index e2bf6637de..a6e3b21c8b 100644
--- a/dist/Math-BigInt/t/mbi_rand.t
+++ b/dist/Math-BigInt/t/mbi_rand.t
@@ -1,21 +1,14 @@
#!/usr/bin/perl -w
-use Test::More;
use strict;
my $count;
-
-BEGIN
- {
- $| = 1;
- if ($^O eq 'os390') { print "1..0\n"; exit(0) } # test takes too long there
- unshift @INC, '../lib'; # for running manually
- my $location = $0; $location =~ s/mbi_rand.t//;
- unshift @INC, $location; # to locate the testing files
- chdir 't' if -d 't';
+
+BEGIN {
$count = 128;
- plan tests => $count*4;
- }
+}
+
+use Test::More tests => $count*4;
use Math::BigInt;
my $c = 'Math::BigInt';
diff --git a/dist/Math-BigInt/t/mbimbf.t b/dist/Math-BigInt/t/mbimbf.t
index 5bc8793478..94b44b7211 100644
--- a/dist/Math-BigInt/t/mbimbf.t
+++ b/dist/Math-BigInt/t/mbimbf.t
@@ -8,22 +8,6 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/mbimbf.t//i;
- 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 => 684
+ 26; # own tests
}
@@ -36,7 +20,7 @@ use vars qw/$mbi $mbf/;
$mbi = 'Math::BigInt';
$mbf = 'Math::BigFloat';
-require 'mbimbf.inc';
+require 't/mbimbf.inc';
# some tests that won't work with subclasses, since the things are only
# garantied in the Math::BigInt/BigFloat (unless subclass chooses to support
diff --git a/dist/Math-BigInt/t/nan_cmp.t b/dist/Math-BigInt/t/nan_cmp.t
index ffe7b14b23..983edcbddc 100644
--- a/dist/Math-BigInt/t/nan_cmp.t
+++ b/dist/Math-BigInt/t/nan_cmp.t
@@ -3,15 +3,7 @@
# test that overloaded compare works when NaN are involved
use strict;
-use Test::More;
-
-BEGIN
- {
- $| = 1;
- chdir 't' if -d 't';
- unshift @INC, '../lib'; # for running manually
- plan tests => 26;
- }
+use Test::More tests => 26;
use Math::BigInt;
use Math::BigFloat;
diff --git a/dist/Math-BigInt/t/req_mbf0.t b/dist/Math-BigInt/t/req_mbf0.t
index 9c51a16ee5..4df4d4a24b 100644
--- a/dist/Math-BigInt/t/req_mbf0.t
+++ b/dist/Math-BigInt/t/req_mbf0.t
@@ -3,28 +3,7 @@
# check that simple requiring BigFloat and then bzero() works
use strict;
-use Test::More;
-
-BEGIN
- {
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/req_mbf0.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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 => 1;
- }
+use Test::More tests => 1;
require Math::BigFloat;
my $x = Math::BigFloat->bzero(); $x++;
diff --git a/dist/Math-BigInt/t/req_mbf1.t b/dist/Math-BigInt/t/req_mbf1.t
index 964980de28..9f6d1c7cec 100644
--- a/dist/Math-BigInt/t/req_mbf1.t
+++ b/dist/Math-BigInt/t/req_mbf1.t
@@ -7,22 +7,6 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/req_mbf1.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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 => 1;
}
diff --git a/dist/Math-BigInt/t/req_mbfa.t b/dist/Math-BigInt/t/req_mbfa.t
index 2c2f9f2257..a57e66735d 100644
--- a/dist/Math-BigInt/t/req_mbfa.t
+++ b/dist/Math-BigInt/t/req_mbfa.t
@@ -7,22 +7,6 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/req_mbfa.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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 => 1;
}
diff --git a/dist/Math-BigInt/t/req_mbfi.t b/dist/Math-BigInt/t/req_mbfi.t
index b2b655e657..de976becd9 100644
--- a/dist/Math-BigInt/t/req_mbfi.t
+++ b/dist/Math-BigInt/t/req_mbfi.t
@@ -7,22 +7,6 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/req_mbfi.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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 => 1;
}
diff --git a/dist/Math-BigInt/t/req_mbfn.t b/dist/Math-BigInt/t/req_mbfn.t
index 3aa6c3e1f6..f12c18a9e6 100644
--- a/dist/Math-BigInt/t/req_mbfn.t
+++ b/dist/Math-BigInt/t/req_mbfn.t
@@ -7,22 +7,6 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/req_mbfn.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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 => 1;
}
diff --git a/dist/Math-BigInt/t/req_mbfw.t b/dist/Math-BigInt/t/req_mbfw.t
index 682b0cfb96..de52ac2b96 100644
--- a/dist/Math-BigInt/t/req_mbfw.t
+++ b/dist/Math-BigInt/t/req_mbfw.t
@@ -3,28 +3,9 @@
# check that requiring BigFloat and then calling import() works
use strict;
-use Test::More;
-
-BEGIN
- {
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/req_mbfw.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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 => 3;
- }
+use Test::More tests => 3;
+
+BEGIN { unshift @INC, 't'; }
# normal require that calls import automatically (we thus have MBI afterwards)
require Math::BigFloat;
diff --git a/dist/Math-BigInt/t/require.t b/dist/Math-BigInt/t/require.t
index 66bf6279e3..eab33b967b 100644
--- a/dist/Math-BigInt/t/require.t
+++ b/dist/Math-BigInt/t/require.t
@@ -7,22 +7,6 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/require.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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 => 1;
}
diff --git a/dist/Math-BigInt/t/round.t b/dist/Math-BigInt/t/round.t
index 6f4426b107..078e2d055b 100644
--- a/dist/Math-BigInt/t/round.t
+++ b/dist/Math-BigInt/t/round.t
@@ -3,28 +3,7 @@
# test rounding with non-integer A and P parameters
use strict;
-use Test::More;
-
-BEGIN
- {
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/round.t//i;
- unshift @INC, qw(../lib);
- 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 => 95;
- }
+use Test::More tests => 95;
use Math::BigFloat;
diff --git a/dist/Math-BigInt/t/sub_ali.t b/dist/Math-BigInt/t/sub_ali.t
index d6c17530f8..04512abd6c 100644
--- a/dist/Math-BigInt/t/sub_ali.t
+++ b/dist/Math-BigInt/t/sub_ali.t
@@ -2,34 +2,14 @@
# test that the new alias names work
-use Test::More;
use strict;
+use Test::More tests => 6;
-BEGIN
- {
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/sub_ali.t//i;
- unshift @INC, qw(../lib);
- 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 => 6;
- }
+BEGIN { unshift @INC, 't'; }
use Math::BigInt::Subclass;
use vars qw/$CL $x/;
$CL = 'Math::BigInt::Subclass';
-require 'alias.inc';
-
+require 't/alias.inc';
diff --git a/dist/Math-BigInt/t/sub_mbf.t b/dist/Math-BigInt/t/sub_mbf.t
index 95911940aa..d1f00e42d8 100644
--- a/dist/Math-BigInt/t/sub_mbf.t
+++ b/dist/Math-BigInt/t/sub_mbf.t
@@ -5,22 +5,7 @@ use strict;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/sub_mbf.t//i;
- unshift @INC, '../lib';
- 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";
-
+ unshift @INC, 't';
plan tests => 2316
+ 6; # + our own tests
}
@@ -31,7 +16,7 @@ use vars qw ($class $try $x $y $f @args $ans $ans1 $ans1_str $setup $CL);
$class = "Math::BigFloat::Subclass";
$CL = Math::BigFloat->config()->{lib}; # "Math::BigInt::Calc"; or FastCalc
-require 'bigfltpm.inc'; # perform same tests as bigfltpm
+require 't/bigfltpm.inc'; # perform same tests as bigfltpm
###############################################################################
# Now do custom tests for Subclass itself
diff --git a/dist/Math-BigInt/t/sub_mbi.t b/dist/Math-BigInt/t/sub_mbi.t
index fe89ba407e..14db066490 100644
--- a/dist/Math-BigInt/t/sub_mbi.t
+++ b/dist/Math-BigInt/t/sub_mbi.t
@@ -5,22 +5,7 @@ use strict;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/sub_mbi.t//i;
- unshift @INC, qw(../lib);
- 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";
-
+ unshift @INC, 't';
plan tests => 3279
+ 5; # +5 own tests
}
@@ -33,7 +18,7 @@ $CL = "Math::BigInt::Calc";
my $version = '0.02'; # for $VERSION tests, match current release (by hand!)
-require 'bigintpm.inc'; # perform same tests as bigintpm
+require 't/bigintpm.inc'; # perform same tests as bigintpm
###############################################################################
# Now do custom tests for Subclass itself
diff --git a/dist/Math-BigInt/t/sub_mif.t b/dist/Math-BigInt/t/sub_mif.t
index 14d041b3da..ef59c0564f 100644
--- a/dist/Math-BigInt/t/sub_mif.t
+++ b/dist/Math-BigInt/t/sub_mif.t
@@ -8,22 +8,7 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/sub_mif.t//i;
- 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";
-
+ unshift @INC, 't';
plan tests => 684;
}
@@ -35,5 +20,5 @@ use vars qw/$mbi $mbf/;
$mbi = 'Math::BigInt::Subclass';
$mbf = 'Math::BigFloat::Subclass';
-require 'mbimbf.inc';
+require 't/mbimbf.inc';
diff --git a/dist/Math-BigInt/t/trap.t b/dist/Math-BigInt/t/trap.t
index 94a7da4acb..c3348b3d1f 100644
--- a/dist/Math-BigInt/t/trap.t
+++ b/dist/Math-BigInt/t/trap.t
@@ -2,16 +2,8 @@
# test that config ( trap_nan => 1, trap_inf => 1) really works/dies
+use Test::More tests => 43;
use strict;
-use Test::More;
-
-BEGIN
- {
- $| = 1;
- chdir 't' if -d 't';
- unshift @INC, '../lib'; # for running manually
- plan tests => 43;
- }
use Math::BigInt;
use Math::BigFloat;
diff --git a/dist/Math-BigInt/t/upgrade.t b/dist/Math-BigInt/t/upgrade.t
index dff9c326b3..a62189cfb2 100644
--- a/dist/Math-BigInt/t/upgrade.t
+++ b/dist/Math-BigInt/t/upgrade.t
@@ -5,22 +5,6 @@ use strict;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/upgrade.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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 => 2112
+ 2; # our own tests
}
@@ -37,4 +21,4 @@ $ECL = "Math::BigFloat";
ok (Math::BigInt->upgrade(),'Math::BigFloat');
ok (Math::BigInt->downgrade()||'','');
-require 'upgrade.inc'; # all tests here for sharing
+require 't/upgrade.inc'; # all tests here for sharing
diff --git a/dist/Math-BigInt/t/upgradef.t b/dist/Math-BigInt/t/upgradef.t
index 2bc4a482ed..58381cc05f 100644
--- a/dist/Math-BigInt/t/upgradef.t
+++ b/dist/Math-BigInt/t/upgradef.t
@@ -5,22 +5,6 @@ use strict;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/upgradef.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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 => 0
+ 6; # our own tests
}
diff --git a/dist/Math-BigInt/t/use.t b/dist/Math-BigInt/t/use.t
index 4865ba5399..4ece8fefc6 100644
--- a/dist/Math-BigInt/t/use.t
+++ b/dist/Math-BigInt/t/use.t
@@ -10,22 +10,6 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/use.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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 => 1;
}
diff --git a/dist/Math-BigInt/t/use_lib1.t b/dist/Math-BigInt/t/use_lib1.t
index ecb60eb0a4..d31881451c 100644
--- a/dist/Math-BigInt/t/use_lib1.t
+++ b/dist/Math-BigInt/t/use_lib1.t
@@ -8,22 +8,7 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/use_lib1.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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";
-
+ unshift @INC, 't';
plan tests => 2;
}
diff --git a/dist/Math-BigInt/t/use_lib2.t b/dist/Math-BigInt/t/use_lib2.t
index 298ff7d0e8..fbd0c9b0cc 100644
--- a/dist/Math-BigInt/t/use_lib2.t
+++ b/dist/Math-BigInt/t/use_lib2.t
@@ -8,22 +8,7 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/use_lib2.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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";
-
+ unshift @INC, 't';
plan tests => 2;
}
diff --git a/dist/Math-BigInt/t/use_lib3.t b/dist/Math-BigInt/t/use_lib3.t
index 06a1086554..503230b6e1 100644
--- a/dist/Math-BigInt/t/use_lib3.t
+++ b/dist/Math-BigInt/t/use_lib3.t
@@ -8,22 +8,7 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/use_lib3.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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";
-
+ unshift @INC, 't';
plan tests => 2;
}
diff --git a/dist/Math-BigInt/t/use_lib4.t b/dist/Math-BigInt/t/use_lib4.t
index 070beb8755..fbb1ffd979 100644
--- a/dist/Math-BigInt/t/use_lib4.t
+++ b/dist/Math-BigInt/t/use_lib4.t
@@ -9,22 +9,7 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/use_lib4.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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";
-
+ unshift @INC, 't';
plan tests => 2;
}
diff --git a/dist/Math-BigInt/t/use_mbfw.t b/dist/Math-BigInt/t/use_mbfw.t
index 298cb800da..43fcfab6e6 100644
--- a/dist/Math-BigInt/t/use_mbfw.t
+++ b/dist/Math-BigInt/t/use_mbfw.t
@@ -8,22 +8,7 @@ use Test;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/use_mbfw.t//i;
- unshift @INC, qw(../lib); # to locate the modules
- 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";
-
+ unshift @INC, 't';
plan tests => 2;
}
diff --git a/dist/Math-BigInt/t/with_sub.t b/dist/Math-BigInt/t/with_sub.t
index eecc0e17a2..b84069150e 100644
--- a/dist/Math-BigInt/t/with_sub.t
+++ b/dist/Math-BigInt/t/with_sub.t
@@ -7,22 +7,7 @@ use strict;
BEGIN
{
- $| = 1;
- # to locate the testing files
- my $location = $0; $location =~ s/with_sub.t//i;
- unshift @INC, '../lib';
- 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";
-
+ unshift @INC, 't';
plan tests => 2316
+ 1;
}
@@ -36,4 +21,4 @@ $CL = "Math::BigInt::Calc";
# the with argument is ignored
ok (Math::BigFloat->config()->{with}, 'Math::BigInt::Calc');
-require 'bigfltpm.inc'; # all tests here for sharing
+require 't/bigfltpm.inc'; # all tests here for sharing