#!perl -w
-# Copyright (C) 2017-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict;
use v5.10.1;
use PublicInbox::Eml;
use PublicInbox::Config;
use PublicInbox::Inbox;
-use bytes (); # only for bytes::length
my @mods = qw(DBD::SQLite Search::Xapian HTTP::Request::Common Plack::Test
URI::Escape Plack::Builder);
require_mods(@mods);
is($res->code, 200, 'successful search result');
is_deeply([], $warn, 'no warnings from non-numeric comparison');
+ $res = $cb->(GET('/test/?&q=s:test'));
+ is($res->code, 200, 'successful search result');
+ is_deeply([], $warn, 'no warnings from black parameter');
+
$res = $cb->(POST('/test/?q=s:bogus&x=m'));
is($res->code, 404, 'failed search result gives 404');
+ like($res->content, qr/No results found/, "`No results' shown");
is_deeply([], $warn, 'no warnings');
my $mid_re = qr/\Q$mid\E/o;
like($res->content, $mid_re, 'found mid in response');
chop($digits);
}
+ $res = $cb->(GET("/test/$mid/"));
+ $html = $res->content;
+ like($html, qr/\bFrom: Ævar /,
+ "displayed Ævar's name properly in permalink From:");
+ unlike($html, qr/Ã/, 'no raw octets in permalink HTML');
$res = $cb->(GET('/test/'));
$html = $res->content;