line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Mojo::Role::Debug::JSON; |
2
|
|
|
|
|
|
|
$Test::Mojo::Role::Debug::JSON::VERSION = '0.004'; |
3
|
|
|
|
|
|
|
# ABSTRACT: a JSON extension to Test::Mojo::Role::Debug |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1215
|
use Mojo::Base -role; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
with 'Test::Mojo::Role::Debug'; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
517
|
use Carp qw/croak/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
56
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
6
|
use Mojo::JSON qw{from_json}; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
12
|
1
|
|
|
1
|
|
6
|
use Mojo::JSON::Pointer; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
13
|
1
|
|
|
1
|
|
25
|
use Test::More (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
240
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# VERSION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub djson { |
18
|
4
|
|
|
4
|
1
|
54178
|
my ( $self, $pointer ) = @_; |
19
|
4
|
100
|
|
|
|
12
|
return $self->success ? $self : $self->djsona( $pointer ); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub djsona { |
23
|
4
|
|
|
4
|
1
|
16258
|
my ( $self, $pointer ) = @_; |
24
|
|
|
|
|
|
|
|
25
|
4
|
|
|
|
|
7
|
local $@; |
26
|
4
|
|
|
|
|
9
|
my $json = eval { from_json( $self->tx->res->content->asset->slurp ) }; |
|
4
|
|
|
|
|
13
|
|
27
|
|
|
|
|
|
|
|
28
|
4
|
50
|
0
|
|
|
565
|
Test::More::diag( $@ ) && return $self if $@; |
29
|
4
|
50
|
100
|
|
|
23
|
Test::More::diag( "DEBUG JSON DUMPER:\n", |
30
|
|
|
|
|
|
|
Test::More::explain( Mojo::JSON::Pointer->new($json)->get($pointer || '') ) |
31
|
|
|
|
|
|
|
) if ref $json; |
32
|
|
|
|
|
|
|
|
33
|
4
|
|
|
|
|
1330
|
return $self; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |