about summary refs log tree commit homepage
path: root/t/psgi_v2.t
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-03 11:09:10 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-03 12:06:14 +0000
commit0dceebd0a85774c92af247e6da5e2f5a0ee8417c (patch)
treedddcaa1a358a73f0a1da781a9dfd57e2a9ab2ccb /t/psgi_v2.t
parentb9534449ecce2c59bb4aebad6051f91c3116b187 (diff)
downloadpublic-inbox-0dceebd0a85774c92af247e6da5e2f5a0ee8417c.tar.gz
We can use id_batch in the common case to speed up full mbox
retrievals.  Gigantic msets are still a problem, but will
be fixed in future commits.
Diffstat (limited to 't/psgi_v2.t')
-rw-r--r--t/psgi_v2.t22
1 files changed, 21 insertions, 1 deletions
diff --git a/t/psgi_v2.t b/t/psgi_v2.t
index 31c4178b..aa3279cc 100644
--- a/t/psgi_v2.t
+++ b/t/psgi_v2.t
@@ -125,8 +125,28 @@ test_psgi(sub { $www->call(@_) }, sub {
                 like($out, qr/^hello world$/m, 'got first in t.mbox.gz');
                 like($out, qr/^hello world!$/m, 'got second in t.mbox.gz');
                 like($out, qr/^hello ghosts$/m, 'got third in t.mbox.gz');
-                @from_ = ($raw =~ m/^From /mg);
+                @from_ = ($out =~ m/^From /mg);
                 is(scalar(@from_), 3, 'three From_ lines in t.mbox.gz');
+
+                # search interface
+                $res = $cb->(POST('/v2test/?q=m:a-mid@b&x=m'));
+                $in = $res->content;
+                $status = IO::Uncompress::Gunzip::gunzip(\$in => \$out);
+                like($out, qr/^hello world$/m, 'got first in mbox POST');
+                like($out, qr/^hello world!$/m, 'got second in mbox POST');
+                like($out, qr/^hello ghosts$/m, 'got third in mbox POST');
+                @from_ = ($out =~ m/^From /mg);
+                is(scalar(@from_), 3, 'three From_ lines in mbox POST');
+
+                # all.mbox.gz interface
+                $res = $cb->(GET('/v2test/all.mbox.gz'));
+                $in = $res->content;
+                $status = IO::Uncompress::Gunzip::gunzip(\$in => \$out);
+                like($out, qr/^hello world$/m, 'got first in all.mbox');
+                like($out, qr/^hello world!$/m, 'got second in all.mbox');
+                like($out, qr/^hello ghosts$/m, 'got third in all.mbox');
+                @from_ = ($out =~ m/^From /mg);
+                is(scalar(@from_), 3, 'three From_ lines in all.mbox');
         };
 
         local $SIG{__WARN__} = 'DEFAULT';