line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Config::IOD; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2021-06-21'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.351'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
## no critic (Modules::ProhibitAutomaticExportation) |
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
3778
|
use 5.010; |
|
6
|
|
|
|
|
57
|
|
9
|
6
|
|
|
6
|
|
32
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
182
|
|
10
|
6
|
|
|
6
|
|
37
|
use warnings; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
160
|
|
11
|
|
|
|
|
|
|
|
12
|
6
|
|
|
6
|
|
3993
|
use Test::Differences; |
|
6
|
|
|
|
|
120432
|
|
|
6
|
|
|
|
|
484
|
|
13
|
6
|
|
|
6
|
|
3709
|
use Test::Exception; |
|
6
|
|
|
|
|
410829
|
|
|
6
|
|
|
|
|
25
|
|
14
|
6
|
|
|
6
|
|
6233
|
use Test::More; |
|
6
|
|
|
|
|
38383
|
|
|
6
|
|
|
|
|
52
|
|
15
|
6
|
|
|
6
|
|
5269
|
use Config::IOD; |
|
6
|
|
|
|
|
18
|
|
|
6
|
|
|
|
|
220
|
|
16
|
|
|
|
|
|
|
|
17
|
6
|
|
|
6
|
|
52
|
use Exporter qw(import); |
|
6
|
|
|
|
|
17
|
|
|
6
|
|
|
|
|
1814
|
|
18
|
|
|
|
|
|
|
our @EXPORT = qw(test_modify_doc); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub test_modify_doc { |
21
|
49
|
|
|
49
|
1
|
85428
|
my $opts; |
22
|
49
|
100
|
|
|
|
162
|
if (ref($_[0]) eq 'HASH') { |
23
|
18
|
|
|
|
|
35
|
$opts = shift; |
24
|
|
|
|
|
|
|
} else { |
25
|
31
|
|
|
|
|
61
|
$opts = {}; |
26
|
|
|
|
|
|
|
} |
27
|
49
|
|
|
|
|
160
|
my ($code, $doc1, $doc2, $name) = @_; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
subtest +($name // "test_modify_doc") => sub { |
30
|
49
|
|
|
49
|
|
39730
|
my $iod = Config::IOD->new; |
31
|
49
|
|
|
|
|
1247
|
my $doc = $iod->read_string($doc1); |
32
|
49
|
100
|
|
|
|
125
|
if ($opts->{dies}) { |
33
|
18
|
50
|
|
|
|
109
|
dies_ok { $code->($doc) } "dies" |
|
18
|
|
|
|
|
608
|
|
34
|
|
|
|
|
|
|
or return 0; |
35
|
18
|
|
|
|
|
7473
|
return 1; |
36
|
|
|
|
|
|
|
} else { |
37
|
31
|
50
|
|
|
|
189
|
lives_ok { $code->($doc) } "lives" |
|
31
|
|
|
|
|
1042
|
|
38
|
|
|
|
|
|
|
or return 0; |
39
|
|
|
|
|
|
|
} |
40
|
31
|
|
|
|
|
21052
|
eq_or_diff $doc->as_string, $doc2, "result"; |
41
|
49
|
|
50
|
|
|
322
|
}; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
# ABSTRACT: Testing routines for Config::IOD |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |