X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fpsgi_search.t;h=3da93eda718cd7335c2b1f747f2a7f16e2bf880e;hb=refs%2Fheads%2Fmaster;hp=5bdd66edf2bee703e68fd5646d34cc4821dd6d54;hpb=5ef37f4a13e2be711ef074dc2cd9994005273117;p=public-inbox.git diff --git a/t/psgi_search.t b/t/psgi_search.t index 5bdd66ed..27946391 100644 --- a/t/psgi_search.t +++ b/t/psgi_search.t @@ -1,5 +1,5 @@ #!perl -w -# Copyright (C) 2017-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ use strict; use v5.10.1; @@ -8,7 +8,6 @@ use IO::Uncompress::Gunzip qw(gunzip); 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); @@ -94,6 +93,7 @@ test_psgi(sub { $www->call(@_) }, sub { $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; @@ -104,6 +104,11 @@ test_psgi(sub { $www->call(@_) }, sub { 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;