xref: /openbsd-src/gnu/usr.bin/perl/cpan/Test-Simple/t/lib/Test/Simple/Catch.pm (revision 91f110e064cd7c194e59e019b83bb7496c1c84d4)
1# For testing Test::Simple;
2package Test::Simple::Catch;
3
4use strict;
5
6use Symbol;
7use TieOut;
8my( $out_fh, $err_fh ) = ( gensym, gensym );
9my $out = tie *$out_fh, 'TieOut';
10my $err = tie *$err_fh, 'TieOut';
11
12use Test::Builder;
13my $t = Test::Builder->new;
14$t->output($out_fh);
15$t->failure_output($err_fh);
16$t->todo_output($err_fh);
17
18sub caught { return( $out, $err ) }
19
201;
21