about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-18 20:58:35 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-18 20:58:35 +0000
commitcfb8d16578e7f2f2e300f9f436205e4a8fc7f322 (patch)
tree2b102728613d0019102dccb6d281ed9aaec03326 /t
parent1dc0f0c10fd856166a6726034de8aec53392901a (diff)
parent119463b3b8517e5ec149198bb83588999118ee1d (diff)
downloadpublic-inbox-cfb8d16578e7f2f2e300f9f436205e4a8fc7f322.tar.gz
* origin/master:
  nntp: allow and ignore empty commands
  mbox: do not barf on queries which return no results
  nntp: fix NEWNEWS command
  searchview: fix non-numeric comparison
  Allow specification of the number of search results to return
  githttpbackend: avoid infinite loop on generic PSGI servers
  http: fix modification of read-only value
  extmsg: use news.gmane.org for Message-ID lookups
  extmsg: rework partial MID matching to favor current inbox
  Update the installation instructions with Fedora package names
  nntp: do not drain rbuf if there is a command pending
  nntp: improve fairness during XOVER and similar commands
  searchidx: do not modify Xapian DB while iterating
  Don't use LIMIT in UPDATE statements
Diffstat (limited to 't')
-rw-r--r--t/nntpd.t2
-rw-r--r--t/psgi_search.t10
2 files changed, 12 insertions, 0 deletions
diff --git a/t/nntpd.t b/t/nntpd.t
index c6e34ed3..3698f98b 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -147,6 +147,8 @@ EOF
         is($buf, "201 server ready - post via email\r\n", 'got greeting');
         $s->autoflush(1);
 
+        ok(syswrite($s, "   \r\n"), 'wrote spaces');
+        ok(syswrite($s, "\r\n"), 'wrote nothing');
         syswrite($s, "NEWGROUPS\t19990424 000000 \033GMT\007\r\n");
         is(0, sysread($s, $buf, 4096), 'GOT EOF on cntrl');
 
diff --git a/t/psgi_search.t b/t/psgi_search.t
index 60a44bde..2f033016 100644
--- a/t/psgi_search.t
+++ b/t/psgi_search.t
@@ -62,6 +62,16 @@ test_psgi(sub { $www->call(@_) }, sub {
         is('%C3%86var', (keys %uniq)[0], 'matches original query');
         ok(index($html, 'by &#198;var Arnfj&#246;r&#240; Bjarmason') >= 0,
                 "displayed Ævar's name properly in HTML");
+
+        my $warn = [];
+        local $SIG{__WARN__} = sub { push @$warn, @_ };
+        $res = $cb->(GET('/test/?q=s:test&l=5e'));
+        is($res->code, 200, 'successful search result');
+        is_deeply([], $warn, 'no warnings from non-numeric comparison');
+
+        $res = $cb->(POST('/test/?q=s:bogus&x=m'));
+        is($res->code, 404, 'failed search result gives 404');
+        is_deeply([], $warn, 'no warnings');
 });
 
 done_testing();