line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Chai::Core::Assertions::Bool; |
2
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
54
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
49
|
|
4
|
2
|
|
|
2
|
|
11
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
49
|
use Exporter qw/import/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
117
|
|
7
|
|
|
|
|
|
|
our @EXPORT_OK = qw/assert_true assert_false/; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
11
|
use Scalar::Util qw/looks_like_number/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
105
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
10
|
use Test::Chai::Util::Flag qw/flag/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
365
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub assert_true { |
14
|
3
|
|
|
3
|
0
|
6
|
my $self = shift; |
15
|
3
|
|
|
|
|
8
|
my $obj = flag($self, 'object'); |
16
|
3
|
|
100
|
|
|
33
|
return $self->assert( |
17
|
|
|
|
|
|
|
looks_like_number($obj) && $obj == 1, |
18
|
|
|
|
|
|
|
'expected #{this} to be 1', |
19
|
|
|
|
|
|
|
'expected #{this} to be 0' |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub assert_false { |
24
|
3
|
|
|
3
|
0
|
7
|
my $self = shift; |
25
|
3
|
|
|
|
|
10
|
my $obj = flag($self, 'object'); |
26
|
3
|
|
100
|
|
|
28
|
return $self->assert( |
27
|
|
|
|
|
|
|
looks_like_number($obj) && $obj == 0, |
28
|
|
|
|
|
|
|
'expected #{this} to be 0', |
29
|
|
|
|
|
|
|
'expected #{this} to be 1' |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |