line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Unit::Exception; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
2
|
|
|
2
|
|
40
|
$Test::Unit::Exception::VERSION = '0.25_1325'; # added by dist-tools/SetVersion.pl |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
49
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
9
|
use Carp; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
146
|
|
9
|
2
|
|
|
2
|
|
2400
|
use Error; |
|
2
|
|
|
|
|
15813
|
|
|
2
|
|
|
|
|
12
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
158
|
use base 'Error'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1160
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub throw_new { |
14
|
69
|
|
|
69
|
0
|
110
|
my $self = shift; |
15
|
69
|
|
|
|
|
116
|
my $class = ref $self; |
16
|
69
|
50
|
|
|
|
89
|
$class->throw(%{$self || {}},@_); |
|
69
|
|
|
|
|
167
|
|
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub stacktrace { |
20
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
21
|
0
|
|
|
|
|
0
|
warn "Stacktrace is deprecated and no longer works" |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub get_message { |
25
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
26
|
0
|
|
|
|
|
0
|
$self->text; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub hide_backtrace { |
30
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
31
|
0
|
|
|
|
|
0
|
$self->{_hide_backtrace} = 1; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub stringify { |
35
|
35
|
|
|
35
|
1
|
90
|
my $self = shift; |
36
|
35
|
|
|
|
|
168
|
my $file = $self->file; |
37
|
35
|
|
|
|
|
242
|
my $line = $self->line; |
38
|
35
|
|
50
|
|
|
263
|
my $message = $self->text || 'Died'; |
39
|
35
|
|
|
|
|
277
|
my $object = $self->object; |
40
|
|
|
|
|
|
|
|
41
|
35
|
|
|
|
|
208
|
my $str = "$file:$line"; |
42
|
35
|
100
|
66
|
|
|
223
|
$str .= ' - ' . $object->to_string() if $object && $object->can('to_string'); |
43
|
35
|
|
|
|
|
82
|
$str .= "\n" . $message; |
44
|
35
|
|
|
|
|
196
|
return $str; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub to_string { |
48
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
49
|
0
|
|
|
|
|
|
$self->stringify; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub failed_test { |
53
|
0
|
|
|
0
|
0
|
|
carp "Test::Unit::Exception::failed_test called"; |
54
|
0
|
|
|
|
|
|
return $_[0]->object; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub thrown_exception { |
58
|
0
|
|
|
0
|
0
|
|
carp "Test::Unit::Exception::thrown_exception called"; |
59
|
0
|
|
|
|
|
|
return $_[0]->object; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
__END__ |