Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
skip tests if euc-jp is not supported on the system
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package t::TestLib; | ||
use strict; | ||
use base qw( Exporter ); | ||
|
||
our @EXPORT = qw( xmllib_support_encoding ); | ||
use XML::Atom; | ||
|
||
sub xmllib_support_encoding { | ||
my $enc = shift; | ||
|
||
my $xml = qq(<?xml version="1.0" encoding="$enc"?>\n<foo />); | ||
if (LIBXML) { | ||
eval { XML::LibXML->new->parse_string($xml) }; | ||
return $@ ? 0 : 1; | ||
} else { | ||
eval { XML::XPath->new(xml => $xml) }; | ||
return $@ ? 0 : 1; | ||
} | ||
} | ||
|
||
1; |