line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Unit::Exception; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
77
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
22
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
378
|
|
6
|
2
|
|
|
2
|
|
4075
|
use Error; |
|
2
|
|
|
|
|
20421
|
|
|
2
|
|
|
|
|
15
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1758
|
use base 'Error'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1094
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub throw_new { |
11
|
69
|
|
|
69
|
0
|
735
|
my $self = shift; |
12
|
69
|
|
|
|
|
138
|
my $class = ref $self; |
13
|
69
|
50
|
|
|
|
102
|
$class->throw(%{$self || {}},@_); |
|
69
|
|
|
|
|
209
|
|
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub stacktrace { |
17
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
18
|
0
|
|
|
|
|
0
|
warn "Stacktrace is deprecated and no longer works" |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub get_message { |
22
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
23
|
0
|
|
|
|
|
0
|
$self->text; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub hide_backtrace { |
27
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
28
|
0
|
|
|
|
|
0
|
$self->{_hide_backtrace} = 1; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub stringify { |
32
|
33
|
|
|
33
|
1
|
50
|
my $self = shift; |
33
|
33
|
|
|
|
|
115
|
my $file = $self->file; |
34
|
33
|
|
|
|
|
227
|
my $line = $self->line; |
35
|
33
|
|
50
|
|
|
229
|
my $message = $self->text || 'Died'; |
36
|
33
|
|
|
|
|
274
|
my $object = $self->object; |
37
|
|
|
|
|
|
|
|
38
|
33
|
|
|
|
|
193
|
my $str = "$file:$line"; |
39
|
33
|
100
|
66
|
|
|
255
|
$str .= ' - ' . $object->to_string() if $object && $object->can('to_string'); |
40
|
33
|
|
|
|
|
88
|
$str .= "\n" . $message; |
41
|
33
|
|
|
|
|
181
|
return $str; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub to_string { |
45
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
46
|
0
|
|
|
|
|
|
$self->stringify; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub failed_test { |
50
|
0
|
|
|
0
|
0
|
|
carp "Test::Unit::Exception::failed_test called"; |
51
|
0
|
|
|
|
|
|
return $_[0]->object; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub thrown_exception { |
55
|
0
|
|
|
0
|
0
|
|
carp "Test::Unit::Exception::thrown_exception called"; |
56
|
0
|
|
|
|
|
|
return $_[0]->object; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
__END__ |