line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Unit::Assertion; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
68
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
10
|
use Carp; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
122
|
|
6
|
2
|
|
|
2
|
|
10
|
use Test::Unit::Failure; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
10
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
179
|
use overload '""' => 'to_string'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
17
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub fail { |
11
|
14
|
|
|
14
|
0
|
20
|
my $self = shift; |
12
|
14
|
|
|
|
|
69
|
my($asserter, $file, $line) = caller(2); # We're always called from |
13
|
|
|
|
|
|
|
# within an Assertion... |
14
|
14
|
|
|
|
|
108
|
Test::Unit::Failure->throw(-object => $self, |
15
|
|
|
|
|
|
|
-file => $file, |
16
|
|
|
|
|
|
|
-line => $line, |
17
|
|
|
|
|
|
|
-text => join '', @_); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub do_assertion { |
21
|
0
|
|
|
0
|
1
|
|
Carp::croak("$_[0] forgot to override do_assertion"); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub new { |
25
|
0
|
|
|
0
|
1
|
|
Carp::croak("$_[0] forgot to override new"); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |