File Coverage

blib/lib/XML/Liberal/Remedy/UnquotedAttribute.pm
Criterion Covered Total %
statement 11 13 84.6
branch 3 4 75.0
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 17 21 80.9


line stmt bran cond sub pod time code
1             package XML::Liberal::Remedy::UnquotedAttribute;
2 5     5   2341 use strict;
  5         9  
  5         126  
3              
4 5     5   18 use List::Util qw( min );
  5         7  
  5         812  
5              
6             sub apply {
7 27     27 0 50 my $class = shift;
8 27         53 my($driver, $error, $xml_ref) = @_;
9              
10 27 100       61 return 0 if $error->message !~ /^parser error : AttValue: \" or \' expected/;
11              
12 16         185 pos($$xml_ref) = $error->location;
13 16 50       261 return 1 if $$xml_ref =~ s/\G([^\s>"]*)/"$1"/;
14              
15 0           Carp::carp("Can't find unquoted attribute in line, error was: ",
16             $error->summary);
17 0           return 0;
18             }
19              
20             1;