]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/cgi.t
t/msgtime: skip test if timezone isn't UTC
[public-inbox.git] / t / cgi.t
diff --git a/t/cgi.t b/t/cgi.t
index 5760596ca66cda6fcf61f734f41a6c04da6615f4..97bdebd982a191e5cd96ec83620f097af7f721ae 100644 (file)
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2014-2020 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 # FIXME: this test is too slow and most non-CGI-requirements
 # should be moved over to things which use test_psgi
@@ -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 };
        }
 }