line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Tools::JSON::Pointer; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
269951
|
use strict; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
59
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
50
|
|
5
|
2
|
|
|
2
|
|
11
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
6
|
2
|
|
|
2
|
|
74
|
use 5.008001; |
|
2
|
|
|
|
|
14
|
|
7
|
2
|
|
|
2
|
|
528
|
use JSON::MaybeXS qw( JSON ); |
|
2
|
|
|
|
|
6674
|
|
|
2
|
|
|
|
|
125
|
|
8
|
2
|
|
|
2
|
|
862
|
use Test2::Compare::JSON::Pointer; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
82
|
|
9
|
2
|
|
|
2
|
|
14
|
use parent 'Exporter'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
8
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT = qw( json ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# ABSTRACT: Compare parts of JSON string to data structure using JSON pointers VERSION |
14
|
|
|
|
|
|
|
our $VERSION = '0.01'; # VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub json ($;$) |
18
|
|
|
|
|
|
|
{ |
19
|
8
|
100
|
|
8
|
1
|
72234
|
my($pointer, $json) = @_ == 1 ? ('', $_[0]) : (@_); |
20
|
8
|
|
|
|
|
36
|
my @caller = caller; |
21
|
8
|
|
|
|
|
44
|
Test2::Compare::JSON::Pointer->new( |
22
|
|
|
|
|
|
|
file => $caller[1], |
23
|
|
|
|
|
|
|
lines => [$caller[2]], |
24
|
|
|
|
|
|
|
input => $json, |
25
|
|
|
|
|
|
|
pointer => $pointer, |
26
|
|
|
|
|
|
|
json => JSON->new->utf8, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |