File Coverage

blib/lib/SRU/Utils/XMLTest.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             package SRU::Utils::XMLTest;
2             {
3             $SRU::Utils::XMLTest::VERSION = '1.01';
4             }
5             #ABSTRACT: XML testing utility functions
6              
7 6     6   220719 use strict;
  6         12  
  6         249  
8 6     6   84 use warnings;
  6         13  
  6         163  
9 6     6   24494 use XML::LibXML;
  0            
  0            
10             use base qw( Exporter );
11              
12             our @EXPORT = qw( wellFormedXML );
13              
14              
15             sub wellFormedXML {
16             my $xml_string = shift;
17             eval {
18             my $parser = XML::LibXML->new;
19             $parser->parse_string($xml_string);
20             };
21             return $@ ? 0 : 1;
22             }
23              
24             1;
25              
26             __END__