Subject: | [PATCH] Test failures with older libexpat's |
Solaris Express comes with a fairly old libexpat by default. The
results is some odd looking, but apparently valid XML. Unfortunately,
the test scripts are expecting the XML to come out in a different
format. So, a couple of test script modifications to handle the
differences appear to be needed. There are some additional test
failures, so I'll continue to look into these.
--- t/11-entry.t.old Thu Jun 28 09:12:03 2007
+++ t/11-entry.t Thu Jun 28 09:34:15 2007
@@ -146,17 +146,22 @@
$entry->set($dc, "subject" => "Weblog");
-like $entry->as_xml, qr/<dc:subject .*>Weblog<\/dc:subject>/;
+like $entry->as_xml, qr/<(?:dc:subject|subject
xmlns:dc).*>Weblog<\/(dc:)?subject>/;
$entry->add($dc, "subject" => "Tech");
-like $entry->as_xml, qr/<dc:subject .*>Weblog<\/dc:subject>/;
-like $entry->as_xml, qr/<dc:subject .*>Tech<\/dc:subject>/;
+like $entry->as_xml, qr/<(?:dc:subject|subject
xmlns:dc).*>Weblog<\/(dc:)?subject>/;
+like $entry->as_xml, qr/<(?:dc:subject|subject
xmlns:dc).*>Tech<\/(dc:)?subject>/;
# re-set
$entry->set($dc, "subject" => "Weblog");
-like $entry->as_xml, qr/<dc:subject .*>Weblog<\/dc:subject>/;
+like $entry->as_xml, qr/<(?:dc:subject|subject
xmlns:dc).*>Weblog<\/(dc:)?subject>/;
# euc-jp feed
-$entry = XML::Atom::Entry->new('t/samples/entry-euc.xml');
-is $entry->title, 'ã²ã¹ããªã¼ãµã¼';
-is $entry->content->body, '<p>æ¥æ¬èªã®ãã£ã¼ã</p>';
+SKIP:{
+ eval {
+ $entry = XML::Atom::Entry->new('t/samples/entry-euc.xml');
+ };
+ skip "Cannot handle euc-jp encoded feed", 2 if($@ =~ /Couldn't open
encmap euc-jp.enc/);
+ is $entry->title, 'ã²ã¹ããªã¼ãµã¼';
+ is $entry->content->body, '<p>æ¥æ¬èªã®ãã£ã¼ã</p>';
+}