]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/psgi_v2: test search results Atom feed endpoint
authorEric Wong <e@80x24.org>
Wed, 25 Dec 2019 06:19:47 +0000 (06:19 +0000)
committerEric Wong <e@80x24.org>
Wed, 25 Dec 2019 06:28:28 +0000 (06:28 +0000)
The "x=A" search results endpoint finally gets test coverage.

t/psgi_v2.t

index a02b90fbee2ca8a55468fda116d64114b92d5207..8c619cee08189ef00da350cfcf43ab2382268e7f 100644 (file)
@@ -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, [ '<a', '` <a', '` <a' ], 'threaded messages show up');
 
+       $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");
+       };
+
        local $SIG{__WARN__} = 'DEFAULT';
        $res = $cb->(GET('/v2test/a-mid@b/'));
        $raw = $res->content;