-# Copyright (C) 2018-2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2018-2020 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict;
use warnings;
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');
$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';