blib/lib/Test/Unit/Exception.pm

filter: Statementstmt 35.9% 14 / 39 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 38.4% 5 / 13 Podpod 25.0% 2 / 8 totaltotal 29.1% 21 / 72 CC 5 SCAR 18.6
CC
5
Cov
29%
stringify
20.0
throw_new
6.0
stacktrace
2.0
CRAP 6.4
« blib/lib/Test/Unit/Assertion/Exception.pm ↑ Summary blib/lib/Test/Unit/Debug.pm »
1 package Test::Unit::Exception;
2 BEGIN {
3 6 ▶ $Test::Unit::Exception::VERSION = '0.25_1325'; # added by dist-tools/SetVersion.pl
Subroutine BEGIN: called CC=1 SCAR=0.0
4 }
5  
6 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 6 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use Error;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 6 ▶use base 'Error';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub throw_new {
14 0 ▶ my $self = shift;
Subroutine throw_new: not called CC=2 SCAR=17.9
Pod undocumented
15 0 my $class = ref $self;
16 0 ▶ $class->throw(%{$self || {}},@_);
Branch: 1 branch
BranchTrueFalseTotal
$self or {} 0 0 0
17 }
18  
19 sub stacktrace {
20 0 ▶ my $self = shift;
Subroutine stacktrace: not called CC=1 SCAR=6.9
Pod documented
21 0 warn "Stacktrace is deprecated and no longer works"
22 }
23  
24 sub get_message {
25 0 ▶ my $self = shift;
Subroutine get_message: not called CC=1 SCAR=6.9
Pod undocumented
26 0 $self->text;
27 }
28  
29 sub hide_backtrace {
30 0 ▶ my $self = shift;
Subroutine hide_backtrace: not called CC=1 SCAR=6.9
Pod undocumented
31 0 $self->{_hide_backtrace} = 1;
32 }
33  
34 sub stringify {
35 0 ▶ my $self = shift;
Subroutine stringify: not called CC=4 SCAR=30.0
Pod documented
36 0 my $file = $self->file;
37 0 my $line = $self->line;
38 0 ▶ my $message = $self->text || 'Died';
Condition0%0/2
$self->text || 'Died'
l!l
00
MC/DC0%0/1
$self->text || 'Died'
$self->text
Truth table0%0/2
A
A= $self->text
Aresult
11
00
39 0 my $object = $self->object;
40  
41 0 my $str = "$file:$line";
42 0 ▶ $str .= ' - ' . $object->to_string() if $object && $object->can('to_string');
Branch: 1 branch
BranchTrueFalseTotal
if $object and $object->can("to_string") 0 0 0
Condition0%0/3
$object and $object->can("to_string")
!ll&&!rl&&r
000
MC/DC0%0/2
$object and $object->can("to_string")
$object $object->can("to_string")
Truth table0%0/3
A and B
A= $objectB= $object->can("to_string")
ABresult
0X0
100
111
43 0 $str .= "\n" . $message;
44 0 return $str;
45 }
46  
47 sub to_string {
48 0 ▶ my $self = shift;
Subroutine to_string: not called CC=1 SCAR=6.9
Pod undocumented
49 0 $self->stringify;
50 }
51  
52 sub failed_test {
53 0 ▶ carp "Test::Unit::Exception::failed_test called";
Subroutine failed_test: not called CC=1 SCAR=6.9
Pod undocumented
54 0 return $_[0]->object;
55 }
56  
57 sub thrown_exception {
58 0 ▶ carp "Test::Unit::Exception::thrown_exception called";
Subroutine thrown_exception: not called CC=1 SCAR=6.9
Pod undocumented
59 0 return $_[0]->object;
60 }
61  
62 6 1;
63 __END__
« blib/lib/Test/Unit/Assertion/Exception.pm ↑ Summary blib/lib/Test/Unit/Debug.pm »