X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fpsgi_v2.t;h=2c9387a496cb0d16b31019bf2297d12ecba3d834;hb=9dfddf147f4c8e45eae18d3684e9f60c8a631704;hp=2ecd7458e48eee28467194faa01f14161449397e;hpb=62f28026e624ed30d620063a0fa92cbedb7f6673;p=public-inbox.git diff --git a/t/psgi_v2.t b/t/psgi_v2.t index 2ecd7458..2c9387a4 100644 --- a/t/psgi_v2.t +++ b/t/psgi_v2.t @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2019 all contributors +# Copyright (C) 2018-2020 all contributors # License: AGPL-3.0+ use strict; use warnings; @@ -58,6 +58,9 @@ my $www = PublicInbox::WWW->new($config); my ($res, $raw, @from_); test_psgi(sub { $www->call(@_) }, sub { my ($cb) = @_; + $res = $cb->(GET('/v2test/description')); + like($res->content, qr!\$INBOX_DIR/description missing!, + 'got v2 description missing message'); $res = $cb->(GET('/v2test/a-mid@b/raw')); $raw = $res->content; like($raw, qr/^hello world$/m, 'got first message'); @@ -157,11 +160,11 @@ test_psgi(sub { $www->call(@_) }, sub { $res = $cb->(GET('/v2test/?q=m:a-mid@b&x=A')); is($res->code, 200, 'success with Atom search'); SKIP: { - require_mods(qw(XML::Feed), 2); - $raw = $res->content; - my $p = XML::Feed->parse(\$raw); - is($p->format, "Atom", "parsed atom feed"); - is(scalar $p->entries, 3, "parsed three entries"); + require_mods(qw(XML::TreePP), 2); + my $t = XML::TreePP->new->parse($res->content); + like($t->{feed}->{-xmlns}, qr/\bAtom\b/, + 'looks like an an Atom feed'); + is(scalar @{$t->{feed}->{entry}}, 3, 'parsed three entries'); }; local $SIG{__WARN__} = 'DEFAULT';