File Coverage

blib/lib/Data/Hash/Diff/Smart/Renderer/JSON.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 16 17 94.1


line stmt bran cond sub pod time code
1             package Data::Hash::Diff::Smart::Renderer::JSON;
2              
3 1     1   9 use strict;
  1         2  
  1         70  
4 1     1   6 use warnings;
  1         2  
  1         76  
5              
6 1     1   495 use JSON::MaybeXS;
  1         8959  
  1         166  
7              
8             sub render {
9 4     4 0 7 my ($changes) = @_;
10              
11             # Encode with canonical ordering for stable test output
12 4         40 my $json = JSON::MaybeXS->new(
13             utf8 => 1,
14             canonical => 1,
15             pretty => 0,
16             );
17              
18 4         123 return $json->encode($changes);
19             }
20              
21             1;