line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Chai::AssertionError; |
2
|
4
|
|
|
4
|
|
20
|
use strict; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
101
|
|
3
|
4
|
|
|
4
|
|
19
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
91
|
|
4
|
4
|
|
|
4
|
|
19
|
use utf8; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
24
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
3226
|
use Data::Structure::Util qw/unbless/; |
|
4
|
|
|
|
|
33699
|
|
|
4
|
|
|
|
|
307
|
|
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
1967
|
use Test::Chai::Util::Inspect qw/inspect/; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
300
|
|
9
|
4
|
|
|
4
|
|
1755
|
use Test::Chai::Util::ObjDisplay qw/obj_display/; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
1681
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub exclude { |
12
|
216
|
|
|
216
|
0
|
581
|
my $excludes = [@_]; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $exclude_props = sub { |
15
|
324
|
|
|
324
|
|
594
|
my ($res, $obj) = @_; |
16
|
|
|
|
|
|
|
|
17
|
324
|
|
|
|
|
778
|
for my $key (keys %$obj) { |
18
|
865
|
50
|
|
|
|
1174
|
if (!grep { $_ eq $key } @$excludes) { |
|
3243
|
|
|
|
|
6446
|
|
19
|
865
|
|
|
|
|
2626
|
$res->{$key} = $obj->{$key}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
216
|
|
|
|
|
948
|
}; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
return sub { |
25
|
216
|
|
|
216
|
|
1428
|
my $args = [@_]; |
26
|
216
|
|
|
|
|
286
|
my $i = 0; |
27
|
216
|
|
|
|
|
349
|
my $res = {}; |
28
|
|
|
|
|
|
|
|
29
|
216
|
|
|
|
|
655
|
for (my $i = 0; $i < @$args; $i++) { |
30
|
324
|
|
|
|
|
713
|
$exclude_props->($res, $args->[$i]); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
216
|
|
|
|
|
516
|
return $res; |
34
|
216
|
|
|
|
|
823
|
}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub new { |
38
|
108
|
|
|
108
|
0
|
211
|
my ($class, $message, $_props, $ssf) = @_; |
39
|
|
|
|
|
|
|
|
40
|
108
|
|
|
|
|
301
|
my $extend = exclude('name', 'message', 'stack', 'constructor', 'toJSON'); |
41
|
108
|
|
50
|
|
|
402
|
my $props = $extend->($_props // {}); |
42
|
|
|
|
|
|
|
|
43
|
108
|
|
50
|
|
|
459
|
my $self = { |
44
|
|
|
|
|
|
|
message => $message // 'Unspecified AssertionError', |
45
|
|
|
|
|
|
|
show_diff => 0, |
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
|
48
|
108
|
|
|
|
|
320
|
for my $key (keys %$props) { |
49
|
324
|
|
|
|
|
576
|
$self->{$key} = $props->{$key}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
108
|
|
|
|
|
221
|
bless $self => $class; |
53
|
108
|
|
|
|
|
973
|
return $self; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
108
|
|
|
108
|
0
|
521
|
sub name { 'AssertionError' } |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub message { |
59
|
108
|
|
|
108
|
0
|
154
|
my $self = shift; |
60
|
|
|
|
|
|
|
|
61
|
108
|
|
|
|
|
218
|
my $extend = exclude('constructor', 'toJSON', 'stack'); |
62
|
108
|
|
|
|
|
327
|
my $props = $extend->({ name => $self->name }, unbless($self)); |
63
|
|
|
|
|
|
|
|
64
|
108
|
|
|
|
|
464
|
return inspect($props); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |