From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id F1C281F463 for ; Wed, 25 Dec 2019 06:19:47 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] t/psgi_v2: test search results Atom feed endpoint Date: Wed, 25 Dec 2019 06:19:47 +0000 Message-Id: <20191225061947.16291-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: The "x=A" search results endpoint finally gets test coverage. --- t/psgi_v2.t | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/psgi_v2.t b/t/psgi_v2.t index a02b90fb..8c619cee 100644 --- a/t/psgi_v2.t +++ b/t/psgi_v2.t @@ -154,6 +154,16 @@ test_psgi(sub { $www->call(@_) }, sub { my @over = ($raw =~ m/\d{4}-\d+-\d+\s+\d+:\d+ +(?:\d+\% )?(.+)$/gm); is_deeply(\@over, [ '(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"); + }; + local $SIG{__WARN__} = 'DEFAULT'; $res = $cb->(GET('/v2test/a-mid@b/')); $raw = $res->content;