| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Test::Config::IOD; | 
| 2 |  |  |  |  |  |  |  | 
| 3 |  |  |  |  |  |  | our $DATE = '2021-06-23'; # DATE | 
| 4 |  |  |  |  |  |  | our $VERSION = '0.352'; # VERSION | 
| 5 |  |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | ## no critic (Modules::ProhibitAutomaticExportation) | 
| 7 |  |  |  |  |  |  |  | 
| 8 | 6 |  |  | 6 |  | 3589 | use 5.010; | 
|  | 6 |  |  |  |  | 54 |  | 
| 9 | 6 |  |  | 6 |  | 30 | use strict; | 
|  | 6 |  |  |  |  | 10 |  | 
|  | 6 |  |  |  |  | 191 |  | 
| 10 | 6 |  |  | 6 |  | 32 | use warnings; | 
|  | 6 |  |  |  |  | 14 |  | 
|  | 6 |  |  |  |  | 171 |  | 
| 11 |  |  |  |  |  |  |  | 
| 12 | 6 |  |  | 6 |  | 3829 | use Test::Differences; | 
|  | 6 |  |  |  |  | 118344 |  | 
|  | 6 |  |  |  |  | 491 |  | 
| 13 | 6 |  |  | 6 |  | 3084 | use Test::Exception; | 
|  | 6 |  |  |  |  | 402943 |  | 
|  | 6 |  |  |  |  | 24 |  | 
| 14 | 6 |  |  | 6 |  | 6059 | use Test::More; | 
|  | 6 |  |  |  |  | 38762 |  | 
|  | 6 |  |  |  |  | 52 |  | 
| 15 | 6 |  |  | 6 |  | 4991 | use Config::IOD; | 
|  | 6 |  |  |  |  | 20 |  | 
|  | 6 |  |  |  |  | 216 |  | 
| 16 |  |  |  |  |  |  |  | 
| 17 | 6 |  |  | 6 |  | 46 | use Exporter qw(import); | 
|  | 6 |  |  |  |  | 14 |  | 
|  | 6 |  |  |  |  | 1744 |  | 
| 18 |  |  |  |  |  |  | our @EXPORT = qw(test_modify_doc); | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  | sub test_modify_doc { | 
| 21 | 49 |  |  | 49 | 1 | 85426 | my $opts; | 
| 22 | 49 | 100 |  |  |  | 177 | if (ref($_[0]) eq 'HASH') { | 
| 23 | 18 |  |  |  |  | 31 | $opts = shift; | 
| 24 |  |  |  |  |  |  | } else { | 
| 25 | 31 |  |  |  |  | 61 | $opts = {}; | 
| 26 |  |  |  |  |  |  | } | 
| 27 | 49 |  |  |  |  | 144 | my ($code, $doc1, $doc2, $name) = @_; | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | subtest +($name // "test_modify_doc") => sub { | 
| 30 | 49 |  |  | 49 |  | 41725 | my $iod = Config::IOD->new; | 
| 31 | 49 |  |  |  |  | 1305 | my $doc = $iod->read_string($doc1); | 
| 32 | 49 | 100 |  |  |  | 140 | if ($opts->{dies}) { | 
| 33 | 18 | 50 |  |  |  | 104 | dies_ok { $code->($doc) } "dies" | 
|  | 18 |  |  |  |  | 585 |  | 
| 34 |  |  |  |  |  |  | or return 0; | 
| 35 | 18 |  |  |  |  | 7652 | return 1; | 
| 36 |  |  |  |  |  |  | } else { | 
| 37 | 31 | 50 |  |  |  | 218 | lives_ok { $code->($doc) } "lives" | 
|  | 31 |  |  |  |  | 1129 |  | 
| 38 |  |  |  |  |  |  | or return 0; | 
| 39 |  |  |  |  |  |  | } | 
| 40 | 31 |  |  |  |  | 22160 | eq_or_diff $doc->as_string, $doc2, "result"; | 
| 41 | 49 |  | 50 |  |  | 330 | }; | 
| 42 |  |  |  |  |  |  | } | 
| 43 |  |  |  |  |  |  |  | 
| 44 |  |  |  |  |  |  | 1; | 
| 45 |  |  |  |  |  |  | # ABSTRACT: Testing routines for Config::IOD | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  | __END__ |