line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Tools::JSON; |
2
|
3
|
|
|
3
|
|
421006
|
use strict; |
|
3
|
|
|
|
|
16
|
|
|
3
|
|
|
|
|
91
|
|
3
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
106
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = "0.03"; |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
15
|
use Carp (); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
50
|
|
8
|
3
|
|
|
3
|
|
862
|
use JSON::MaybeXS qw/JSON/; |
|
3
|
|
|
|
|
10386
|
|
|
3
|
|
|
|
|
167
|
|
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
1384
|
use Test2::Compare::JSON(); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
143
|
|
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
|
|
18
|
use Exporter 'import'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
422
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub json ($) { |
22
|
6
|
|
|
6
|
1
|
55700
|
my @caller = caller; |
23
|
6
|
|
|
|
|
33
|
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
|
7953
|
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__ |