about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-21 21:42:23 +0000
committerEric Wong <e@80x24.org>2015-08-21 21:50:13 +0000
commited724ad94ae8eccb7924584b01ec4975abfef48d (patch)
tree1e454a69f1b9d842d0d59e8040395369ba7a413b /t
parentea926383498a4883140086aec3f58d9e468433b9 (diff)
downloadpublic-inbox-ed724ad94ae8eccb7924584b01ec4975abfef48d.tar.gz
Mboxes may be huge, so only support downloading gzipped mboxes
to save bandwidth and to get free checksumming.

Streaming output means we should not be wasting too much memory
on this unless the chosen server sucks.
Diffstat (limited to 't')
-rw-r--r--t/cgi.t11
1 files changed, 8 insertions, 3 deletions
diff --git a/t/cgi.t b/t/cgi.t
index 2747a159..e87f7dca 100644
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -183,15 +183,20 @@ EOF
 {
         local $ENV{HOME} = $home;
         local $ENV{PATH} = $main_path;
-        my $path = "/test/t/blahblah%40example.com.mbox";
+        my $path = "/test/t/blahblah%40example.com.mbox.gz";
         my $res = cgi_run($path);
         like($res->{head}, qr/^Status: 501 /, "search not-yet-enabled");
         my $indexed = system($index, $maindir) == 0;
         if ($indexed) {
                 $res = cgi_run($path);
-                # use Data::Dumper; print STDERR Dumper($res);
                 like($res->{head}, qr/^Status: 200 /, "search returned mbox");
-                like($res->{body}, qr/^From /m, "From lines in mbox");
+                eval {
+                        require IO::Uncompress::Gunzip;
+                        my $in = $res->{body};
+                        my $out;
+                        IO::Uncompress::Gunzip::gunzip(\$in => \$out);
+                        like($out, qr/^From /m, "From lines in mbox");
+                };
         } else {
                 like($res->{head}, qr/^Status: 501 /, "search not available");
         }