diff options
author | Eric Wong <e@yhbt.net> | 2020-02-06 20:59:45 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-02-07 07:21:18 +0000 |
commit | a3cf35c675217ea60a461dd9be7cc5b55c2d5280 (patch) | |
tree | bc35aa6d2dc279f66c9156f6865d80321522786b /t/cgi.t | |
parent | 17e52476687e03fecd579f765ad6864cde0f4203 (diff) | |
download | public-inbox-a3cf35c675217ea60a461dd9be7cc5b55c2d5280.tar.gz |
XML::Feed pulls in a lot of dependencies, some of which XS. That makes testing with blead or any non-OS-supplied Perl installations more time consuming and more difficult because of the need to have development headers and libraries for libexpat1 or libxml2. Performance from libexpat1 or libxml2 for our small tests cases isn't relevant, either, and the pure Perl XML::TreePP seems up to the task. It's also available in CentOS 7.x, FreeBSD 11.x, and Debian, at least.
Diffstat (limited to 't/cgi.t')
-rw-r--r-- | t/cgi.t | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -121,18 +121,19 @@ EOF SKIP: { skip 'DBD::SQLite not available', 2 }; } - my $have_xml_feed = eval { require XML::Feed; 1 } if $indexed; - if ($have_xml_feed) { + my $have_xml_treepp = eval { require XML::TreePP; 1 } if $indexed; + if ($have_xml_treepp) { $path = "/test/blahblah\@example.com/t.atom"; $res = cgi_run($path); like($res->{head}, qr/^Status: 200 /, "atom returned 200"); like($res->{head}, qr!^Content-Type: application/atom\+xml!m, "search returned atom"); - my $p = XML::Feed->parse(\($res->{body})); - is($p->format, "Atom", "parsed atom feed"); - is(scalar $p->entries, 3, "parsed three entries"); + my $t = XML::TreePP->new->parse($res->{body}); + is(scalar @{$t->{feed}->{entry}}, 3, "parsed three entries"); + like($t->{feed}->{-xmlns}, qr/\bAtom\b/, + 'looks like an an Atom feed'); } else { - SKIP: { skip 'DBD::SQLite or XML::Feed missing', 2 }; + SKIP: { skip 'DBD::SQLite or XML::TreePP missing', 2 }; } } |