line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Unit::Assertion::Boolean; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
2
|
|
|
2
|
|
97
|
$Test::Unit::Assertion::Boolean::VERSION = '0.25_1325'; # added by dist-tools/SetVersion.pl |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
77
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# adding this fixes the 'Can't locate object method "fail" via package |
9
|
|
|
|
|
|
|
# "Test::Unit::Assertion::Boolean"' problem under perl 5.005 - Christian |
10
|
2
|
|
|
2
|
|
11
|
use Test::Unit::Assertion; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
131
|
|
11
|
2
|
|
|
2
|
|
14
|
use Test::Unit::Failure; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
17
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
139
|
use base 'Test::Unit::Assertion'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
270
|
|
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
2
|
|
13
|
use overload 'bool' => sub {$ {$_[0]}}; |
|
2
|
|
|
20
|
|
4
|
|
|
2
|
|
|
|
|
23
|
|
|
20
|
|
|
|
|
25
|
|
|
20
|
|
|
|
|
65
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
78
|
|
|
78
|
1
|
124
|
my $class = shift; |
20
|
78
|
|
|
|
|
117
|
my $bool = shift; |
21
|
|
|
|
|
|
|
|
22
|
78
|
|
|
|
|
129
|
my $self = \$bool; |
23
|
78
|
|
|
|
|
419
|
bless $self, $class; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub do_assertion { |
27
|
78
|
|
|
78
|
1
|
110
|
my $self = shift; |
28
|
78
|
100
|
|
|
|
325
|
$$self or $self->fail( @_ ? join('', @_) : "Boolean assertion failed"); |
|
|
100
|
|
|
|
|
|
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub to_string { |
32
|
78
|
|
|
78
|
0
|
109
|
my $self = shift; |
33
|
78
|
100
|
|
|
|
543
|
($$self ? 'TRUE' : 'FALSE') . ' boolean assertion'; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |