diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-25 13:38:08 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-25 13:38:08 +0000 |
commit | 3f2ec160bb5d4b0fa4d71d9d6810ad59d6a54b71 (patch) | |
tree | fdffebfdebf87ffb94bd5a9536da6b029260618b /t | |
parent | 4dd974daccefd178b570ef862ae9d655a6d519cc (diff) | |
download | perl-3f2ec160bb5d4b0fa4d71d9d6810ad59d6a54b71.tar.gz |
Add Test::More, from Michael G Schwern.
p4raw-id: //depot/perl@10914
Diffstat (limited to 't')
-rw-r--r-- | t/lib/Test/More/Catch.pm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/lib/Test/More/Catch.pm b/t/lib/Test/More/Catch.pm new file mode 100644 index 0000000000..aed94682d4 --- /dev/null +++ b/t/lib/Test/More/Catch.pm @@ -0,0 +1,30 @@ +# 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; |