1 # For testing Test::Simple;
2 package Test::Simple::Catch;
4 my $out = tie *Test::Simple::TESTOUT, __PACKAGE__;
5 my $err = tie *Test::Simple::TESTERR, __PACKAGE__;
7 # We have to use them to shut up a "used only once" warning.
8 () = (*Test::Simple::TESTOUT, *Test::Simple::TESTERR);
10 sub caught { return $out, $err }
12 # Prevent Test::Simple from exiting in its END block.
13 *Test::Simple::exit = sub {};
17 $$self .= join '', @_;
23 return bless \$self, $class;