line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Tools::JSON; |
2
|
3
|
|
|
3
|
|
368938
|
use strict; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
72
|
|
3
|
3
|
|
|
3
|
|
13
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
103
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = "0.04"; |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
15
|
use Carp (); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
55
|
|
8
|
3
|
|
|
3
|
|
759
|
use JSON::MaybeXS qw/JSON/; |
|
3
|
|
|
|
|
9420
|
|
|
3
|
|
|
|
|
133
|
|
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
1047
|
use Test2::Compare::JSON(); |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
125
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
%Carp::Internal = ( |
13
|
|
|
|
|
|
|
%Carp::Internal, |
14
|
|
|
|
|
|
|
'Test2::Tools::JSON' => 1, |
15
|
|
|
|
|
|
|
'Test2::Compare::JSON' => 1, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our @EXPORT = qw/json relaxed_json/; |
19
|
3
|
|
|
3
|
|
15
|
use Exporter 'import'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
374
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub json ($) { |
22
|
6
|
|
|
6
|
1
|
44252
|
my @caller = caller; |
23
|
6
|
|
|
|
|
32
|
return Test2::Compare::JSON->new( |
24
|
|
|
|
|
|
|
file => $caller[1], |
25
|
|
|
|
|
|
|
lines => [$caller[2]], |
26
|
|
|
|
|
|
|
inref => $_[0], |
27
|
|
|
|
|
|
|
json => JSON->new->utf8, |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub relaxed_json ($) { |
32
|
1
|
|
|
1
|
1
|
6295
|
my @caller = caller; |
33
|
1
|
|
|
|
|
6
|
return Test2::Compare::JSON->new( |
34
|
|
|
|
|
|
|
file => $caller[1], |
35
|
|
|
|
|
|
|
lines => [$caller[2]], |
36
|
|
|
|
|
|
|
inref => $_[0], |
37
|
|
|
|
|
|
|
json => JSON->new->utf8->relaxed(1), |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |