t/lib/Test/Simple/Catch.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 96.5% 28 / 29 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Test2/Compare/EventMeta.pm ↑ Summary blib/lib/Test2/Event/Exception.pm »
1 # For testing Test::Simple;
2 package Test::Simple::Catch;
3  
4 14 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 14 ▶use Symbol;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 14 ▶use TieOut;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 14 my( $out_fh, $err_fh ) = ( gensym, gensym );
9 14 my $out = tie *$out_fh, 'TieOut';
10 14 my $err = tie *$err_fh, 'TieOut';
11  
12 14 ▶use Test::Builder;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 14 require Test::Builder::Formatter;
14 14 my $t = Test::Builder->new;
15 14 $t->{Stack}->top->format(Test::Builder::Formatter->new);
16 14 $t->output($out_fh);
17 14 $t->failure_output($err_fh);
18 14 $t->todo_output($err_fh);
19  
20 14 ▶sub caught { return( $out, $err ) }
Subroutine caught: called CC=1 SCAR=0.0
Pod undocumented
21  
22 14 1;
« blib/lib/Test2/Compare/EventMeta.pm ↑ Summary blib/lib/Test2/Event/Exception.pm »