line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Chai::Core::Assertions::Equal; |
2
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
49
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
48
|
|
4
|
2
|
|
|
2
|
|
10
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
50
|
use Exporter qw/import/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
113
|
|
7
|
|
|
|
|
|
|
our @EXPORT_OK = qw/assert_equal/; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
12
|
use Test::Chai::Util::Flag qw/flag/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
117
|
|
10
|
2
|
|
|
2
|
|
9
|
use Test::Chai::Util::Equal qw/equal/; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
402
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub assert_equal { |
13
|
15
|
|
|
15
|
0
|
31
|
my ($self, $val, $msg) = @_; |
14
|
|
|
|
|
|
|
|
15
|
15
|
50
|
|
|
|
37
|
flag($self, 'message', $msg) if defined $msg; |
16
|
15
|
|
|
|
|
38
|
my $obj = flag($self, 'object'); |
17
|
|
|
|
|
|
|
|
18
|
15
|
100
|
|
|
|
43
|
if (flag($self, 'deep')) { |
19
|
8
|
|
|
|
|
27
|
return $self->eql($val); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
7
|
|
|
|
|
27
|
return $self->assert( |
23
|
|
|
|
|
|
|
equal($val, $obj), |
24
|
|
|
|
|
|
|
'expected #{this} to equal #{exp}', |
25
|
|
|
|
|
|
|
'expected #{this} to not equal #{exp}', |
26
|
|
|
|
|
|
|
$val, |
27
|
|
|
|
|
|
|
$self->_obj, |
28
|
|
|
|
|
|
|
1 |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |