Some additional files changes for Test-Simple-0.82
[p5sagit/p5-mst-13.2.git] / t / lib / Test / Simple / Catch.pm
1 # For testing Test::Simple;
2 # $Id: /mirror/googlecode/test-more-trunk/t/lib/Test/Simple/Catch.pm 67132 2008-10-01T01:11:04.501643Z schwern  $
3 package Test::Simple::Catch;
4
5 use Symbol;
6 use TieOut;
7 my( $out_fh, $err_fh ) = ( gensym, gensym );
8 my $out = tie *$out_fh, 'TieOut';
9 my $err = tie *$err_fh, 'TieOut';
10
11 use Test::Builder;
12 my $t = Test::Builder->new;
13 $t->output($out_fh);
14 $t->failure_output($err_fh);
15 $t->todo_output($err_fh);
16
17 sub caught { return( $out, $err ) }
18
19 1;