line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::HexDifferences; ## no critic (TidyCode)
|
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
56194
|
use strict;
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
93
|
|
4
|
3
|
|
|
3
|
|
12
|
use warnings;
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
145
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.009';
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
|
|
26
|
use Sub::Exporter -setup => {
|
9
|
|
|
|
|
|
|
exports => [
|
10
|
|
|
|
|
|
|
qw(eq_or_dump_diff dumped_eq_dump_or_diff),
|
11
|
|
|
|
|
|
|
],
|
12
|
|
|
|
|
|
|
groups => {
|
13
|
|
|
|
|
|
|
default => [ qw(eq_or_dump_diff dumped_eq_dump_or_diff) ],
|
14
|
|
|
|
|
|
|
},
|
15
|
3
|
|
|
3
|
|
1552
|
};
|
|
3
|
|
|
|
|
29708
|
|
16
|
3
|
|
|
3
|
|
2571
|
use Test::Differences qw(eq_or_diff);
|
|
3
|
|
|
|
|
45317
|
|
|
3
|
|
|
|
|
179
|
|
17
|
3
|
|
|
3
|
|
1243
|
use Test::HexDifferences::HexDump qw(hex_dump);
|
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
17
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub eq_or_dump_diff {
|
20
|
4
|
|
|
4
|
1
|
24910
|
my ($got, $expected, @more) = @_;
|
21
|
|
|
|
|
|
|
|
22
|
4
|
50
|
33
|
|
|
28
|
my $attr_ref
|
23
|
|
|
|
|
|
|
= ( @more && ref $more[0] eq 'HASH' )
|
24
|
|
|
|
|
|
|
? shift @more
|
25
|
|
|
|
|
|
|
: ();
|
26
|
|
|
|
|
|
|
|
27
|
4
|
|
66
|
|
|
36
|
my $is_not_a_string
|
28
|
|
|
|
|
|
|
= ! defined $got
|
29
|
|
|
|
|
|
|
|| ! defined $expected
|
30
|
|
|
|
|
|
|
|| ref $got
|
31
|
|
|
|
|
|
|
|| ref $expected;
|
32
|
|
|
|
|
|
|
|
33
|
4
|
100
|
|
|
|
25
|
return eq_or_diff(
|
34
|
|
|
|
|
|
|
$is_not_a_string
|
35
|
|
|
|
|
|
|
? (
|
36
|
|
|
|
|
|
|
$got,
|
37
|
|
|
|
|
|
|
$expected,
|
38
|
|
|
|
|
|
|
)
|
39
|
|
|
|
|
|
|
: (
|
40
|
|
|
|
|
|
|
hex_dump($got, $attr_ref),
|
41
|
|
|
|
|
|
|
hex_dump($expected, $attr_ref),
|
42
|
|
|
|
|
|
|
),
|
43
|
|
|
|
|
|
|
@more,
|
44
|
|
|
|
|
|
|
);
|
45
|
|
|
|
|
|
|
}
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub dumped_eq_dump_or_diff {
|
48
|
4
|
|
|
4
|
1
|
23574
|
my ($got, $expected, @more) = @_;
|
49
|
|
|
|
|
|
|
|
50
|
4
|
50
|
33
|
|
|
30
|
my $attr_ref
|
51
|
|
|
|
|
|
|
= ( @more && ref $more[0] eq 'HASH' )
|
52
|
|
|
|
|
|
|
? shift @more
|
53
|
|
|
|
|
|
|
: ();
|
54
|
|
|
|
|
|
|
|
55
|
4
|
100
|
|
|
|
24
|
return eq_or_diff(
|
56
|
|
|
|
|
|
|
defined $got
|
57
|
|
|
|
|
|
|
? hex_dump($got, $attr_ref)
|
58
|
|
|
|
|
|
|
: $got,
|
59
|
|
|
|
|
|
|
$expected,
|
60
|
|
|
|
|
|
|
@more,
|
61
|
|
|
|
|
|
|
);
|
62
|
|
|
|
|
|
|
}
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# $Id$
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1;
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__
|