line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
60085
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
2
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
3
|
|
|
|
|
|
|
package Test::Deep::YAML; |
4
|
|
|
|
|
|
|
BEGIN { |
5
|
1
|
|
|
1
|
|
43
|
$Test::Deep::YAML::AUTHORITY = 'cpan:ETHER'; |
6
|
|
|
|
|
|
|
} |
7
|
|
|
|
|
|
|
# git description: v0.001-13-gc7b3f74 |
8
|
|
|
|
|
|
|
$Test::Deep::YAML::VERSION = '0.002'; |
9
|
|
|
|
|
|
|
# ABSTRACT: A Test::Deep plugin for comparing YAML-encoded data |
10
|
|
|
|
|
|
|
# vim: set ts=8 sw=4 tw=78 et : |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
798
|
use parent 'Test::Deep::Cmp'; |
|
1
|
|
|
|
|
302
|
|
|
1
|
|
|
|
|
5
|
|
13
|
1
|
|
|
1
|
|
16566
|
use Exporter 'import'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
14
|
1
|
|
|
1
|
|
1059
|
use Test::Deep; |
|
1
|
|
|
|
|
9601
|
|
|
1
|
|
|
|
|
200
|
|
15
|
1
|
|
|
1
|
|
1007
|
use Try::Tiny; |
|
1
|
|
|
|
|
1466
|
|
|
1
|
|
|
|
|
56
|
|
16
|
1
|
|
|
1
|
|
772
|
use YAML 'Load'; |
|
1
|
|
|
|
|
7451
|
|
|
1
|
|
|
|
|
420
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our @EXPORT = qw(yaml); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub yaml |
21
|
|
|
|
|
|
|
{ |
22
|
8
|
|
|
8
|
1
|
18408
|
my ($expected) = @_; |
23
|
8
|
|
|
|
|
52
|
return __PACKAGE__->new($expected); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub init |
27
|
|
|
|
|
|
|
{ |
28
|
8
|
|
|
8
|
0
|
49
|
my ($self, $expected) = @_; |
29
|
8
|
|
|
|
|
102
|
$self->{val} = $expected; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub descend |
33
|
|
|
|
|
|
|
{ |
34
|
8
|
|
|
8
|
0
|
27291
|
my ($self, $got) = @_; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $data = try |
37
|
|
|
|
|
|
|
{ |
38
|
8
|
|
|
8
|
|
277
|
Load($got); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
catch |
41
|
|
|
|
|
|
|
{ |
42
|
1
|
|
|
1
|
|
18231
|
chomp($self->{error_message} = $_); |
43
|
1
|
|
|
|
|
6
|
undef; |
44
|
8
|
|
|
|
|
75
|
}; |
45
|
|
|
|
|
|
|
|
46
|
8
|
100
|
66
|
|
|
18003
|
return 0 if not $data or $self->{error_message}; |
47
|
|
|
|
|
|
|
|
48
|
7
|
|
|
|
|
33
|
return Test::Deep::wrap($self->{val})->descend($data); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub diagnostics |
52
|
|
|
|
|
|
|
{ |
53
|
2
|
|
|
2
|
0
|
6644
|
my ($self, $where, $last) = @_; |
54
|
2
|
|
66
|
|
|
18
|
return $self->{error_message} |
55
|
|
|
|
|
|
|
|| $self->{val}->diagnostics($where, $last); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |