From d020a79abca8a7921ca8873afa967fc2b6628b7d Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Thu, 6 Sep 2001 01:41:03 +0000 Subject: Test-Simple syncup from Schwern. p4raw-id: //depot/perl@11905 --- t/lib/Test/More/Catch.pm | 30 ---------------------- t/lib/Test/Simple/Catch.pm | 6 ++--- t/lib/Test/Simple/Catch/More.pm | 30 ++++++++++++++++++++++ t/lib/Test/Simple/sample_tests/death.plx | 6 ++--- t/lib/Test/Simple/sample_tests/death_in_eval.plx | 6 ++--- t/lib/Test/Simple/sample_tests/extras.plx | 6 ++--- t/lib/Test/Simple/sample_tests/five_fail.plx | 6 ++--- .../Test/Simple/sample_tests/last_minute_death.plx | 6 ++--- t/lib/Test/Simple/sample_tests/one_fail.plx | 6 ++--- t/lib/Test/Simple/sample_tests/success.plx | 6 ++--- t/lib/Test/Simple/sample_tests/too_few.plx | 6 ++--- t/lib/Test/Simple/sample_tests/two_fail.plx | 6 ++--- 12 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 t/lib/Test/More/Catch.pm create mode 100644 t/lib/Test/Simple/Catch/More.pm (limited to 't') diff --git a/t/lib/Test/More/Catch.pm b/t/lib/Test/More/Catch.pm deleted file mode 100644 index aed94682d4..0000000000 --- a/t/lib/Test/More/Catch.pm +++ /dev/null @@ -1,30 +0,0 @@ -# For testing Test::More; -package Catch; - -my $out = tie *Test::Simple::TESTOUT, 'Catch'; -tie *Test::More::TESTOUT, 'Catch', $out; -my $err = tie *Test::More::TESTERR, 'Catch'; -tie *Test::Simple::TESTERR, 'Catch', $err; - -# We have to use them to shut up a "used only once" warning. -() = (*Test::More::TESTOUT, *Test::More::TESTERR); - -sub caught { return $out, $err } - - -sub PRINT { - my $self = shift; - $$self .= join '', @_; -} - -sub TIEHANDLE { - my($class, $self) = @_; - my $foo = ''; - $self = $self || \$foo; - return bless $self, $class; -} -sub READ {} -sub READLINE {} -sub GETC {} - -1; diff --git a/t/lib/Test/Simple/Catch.pm b/t/lib/Test/Simple/Catch.pm index 2f8c887d49..3460a64dcb 100644 --- a/t/lib/Test/Simple/Catch.pm +++ b/t/lib/Test/Simple/Catch.pm @@ -1,8 +1,8 @@ # For testing Test::Simple; -package Catch; +package Test::Simple::Catch; -my $out = tie *Test::Simple::TESTOUT, 'Catch'; -my $err = tie *Test::Simple::TESTERR, 'Catch'; +my $out = tie *Test::Simple::TESTOUT, __PACKAGE__; +my $err = tie *Test::Simple::TESTERR, __PACKAGE__; # We have to use them to shut up a "used only once" warning. () = (*Test::Simple::TESTOUT, *Test::Simple::TESTERR); diff --git a/t/lib/Test/Simple/Catch/More.pm b/t/lib/Test/Simple/Catch/More.pm new file mode 100644 index 0000000000..f4dee3f3ad --- /dev/null +++ b/t/lib/Test/Simple/Catch/More.pm @@ -0,0 +1,30 @@ +# For testing Test::More; +package Test::Simple::Catch::More; + +my $out = tie *Test::Simple::TESTOUT, __PACKAGE__; +tie *Test::More::TESTOUT, __PACKAGE__, $out; +my $err = tie *Test::More::TESTERR, __PACKAGE__; +tie *Test::Simple::TESTERR, __PACKAGE__, $err; + +# We have to use them to shut up a "used only once" warning. +() = (*Test::More::TESTOUT, *Test::More::TESTERR); + +sub caught { return $out, $err } + + +sub PRINT { + my $self = shift; + $$self .= join '', @_; +} + +sub TIEHANDLE { + my($class, $self) = @_; + my $foo = ''; + $self = $self || \$foo; + return bless $self, $class; +} +sub READ {} +sub READLINE {} +sub GETC {} + +1; diff --git a/t/lib/Test/Simple/sample_tests/death.plx b/t/lib/Test/Simple/sample_tests/death.plx index 8796eb2451..ef4ba8c188 100644 --- a/t/lib/Test/Simple/sample_tests/death.plx +++ b/t/lib/Test/Simple/sample_tests/death.plx @@ -1,8 +1,8 @@ require Test::Simple; -push @INC, 't', '.'; -require Catch; -my($out, $err) = Catch::caught(); +push @INC, 't/lib'; +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); Test::Simple->import(tests => 5); close STDERR; diff --git a/t/lib/Test/Simple/sample_tests/death_in_eval.plx b/t/lib/Test/Simple/sample_tests/death_in_eval.plx index 969dbb009a..269bffa802 100644 --- a/t/lib/Test/Simple/sample_tests/death_in_eval.plx +++ b/t/lib/Test/Simple/sample_tests/death_in_eval.plx @@ -1,9 +1,9 @@ require Test::Simple; use Carp; -push @INC, 't', '.'; -require Catch; -my($out, $err) = Catch::caught(); +push @INC, 't/lib'; +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); Test::Simple->import(tests => 5); diff --git a/t/lib/Test/Simple/sample_tests/extras.plx b/t/lib/Test/Simple/sample_tests/extras.plx index ed2d6abbbf..c9c89520aa 100644 --- a/t/lib/Test/Simple/sample_tests/extras.plx +++ b/t/lib/Test/Simple/sample_tests/extras.plx @@ -1,8 +1,8 @@ require Test::Simple; -push @INC, 't', '.'; -require Catch; -my($out, $err) = Catch::caught(); +push @INC, 't/lib'; +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); Test::Simple->import(tests => 5); diff --git a/t/lib/Test/Simple/sample_tests/five_fail.plx b/t/lib/Test/Simple/sample_tests/five_fail.plx index c95e4100d5..d33b84519b 100644 --- a/t/lib/Test/Simple/sample_tests/five_fail.plx +++ b/t/lib/Test/Simple/sample_tests/five_fail.plx @@ -1,8 +1,8 @@ require Test::Simple; -push @INC, 't', '.'; -require Catch; -my($out, $err) = Catch::caught(); +push @INC, 't/lib'; +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); Test::Simple->import(tests => 5); diff --git a/t/lib/Test/Simple/sample_tests/last_minute_death.plx b/t/lib/Test/Simple/sample_tests/last_minute_death.plx index e1df5b1970..ef86a63c51 100644 --- a/t/lib/Test/Simple/sample_tests/last_minute_death.plx +++ b/t/lib/Test/Simple/sample_tests/last_minute_death.plx @@ -1,8 +1,8 @@ require Test::Simple; -push @INC, 't', '.'; -require Catch; -my($out, $err) = Catch::caught(); +push @INC, 't/lib'; +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); Test::Simple->import(tests => 5); close STDERR; diff --git a/t/lib/Test/Simple/sample_tests/one_fail.plx b/t/lib/Test/Simple/sample_tests/one_fail.plx index 1762d65df0..99c720250d 100644 --- a/t/lib/Test/Simple/sample_tests/one_fail.plx +++ b/t/lib/Test/Simple/sample_tests/one_fail.plx @@ -1,8 +1,8 @@ require Test::Simple; -push @INC, 't', '.'; -require Catch; -my($out, $err) = Catch::caught(); +push @INC, 't/lib'; +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); Test::Simple->import(tests => 5); diff --git a/t/lib/Test/Simple/sample_tests/success.plx b/t/lib/Test/Simple/sample_tests/success.plx index eb40a2d7d0..585d6c3d79 100644 --- a/t/lib/Test/Simple/sample_tests/success.plx +++ b/t/lib/Test/Simple/sample_tests/success.plx @@ -1,8 +1,8 @@ require Test::Simple; -push @INC, 't', '.'; -require Catch; -my($out, $err) = Catch::caught(); +push @INC, 't/lib'; +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); Test::Simple->import(tests => 5); diff --git a/t/lib/Test/Simple/sample_tests/too_few.plx b/t/lib/Test/Simple/sample_tests/too_few.plx index 36acac94f6..95af8e903b 100644 --- a/t/lib/Test/Simple/sample_tests/too_few.plx +++ b/t/lib/Test/Simple/sample_tests/too_few.plx @@ -1,8 +1,8 @@ require Test::Simple; -push @INC, 't', '.'; -require Catch; -my($out, $err) = Catch::caught(); +push @INC, 't/lib'; +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); Test::Simple->import(tests => 5); diff --git a/t/lib/Test/Simple/sample_tests/two_fail.plx b/t/lib/Test/Simple/sample_tests/two_fail.plx index 5ddb912dec..e3d92296af 100644 --- a/t/lib/Test/Simple/sample_tests/two_fail.plx +++ b/t/lib/Test/Simple/sample_tests/two_fail.plx @@ -1,8 +1,8 @@ require Test::Simple; -push @INC, 't', '.'; -require Catch; -my($out, $err) = Catch::caught(); +push @INC, 't/lib'; +require Test::Simple::Catch; +my($out, $err) = Test::Simple::Catch::caught(); Test::Simple->import(tests => 5); -- cgit v1.2.1