about summary refs log tree commit homepage
path: root/t/html_index.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-22 08:00:37 +0000
committerEric Wong <e@80x24.org>2015-08-22 08:01:53 +0000
commit1761fba7befab2681276ac8f123593610ad27e58 (patch)
tree2725fdbd3691a8f00310e9e9ebf96de2deb321ca /t/html_index.t
parent797ba8046562864a09ed36e6040055babb536615 (diff)
downloadpublic-inbox-1761fba7befab2681276ac8f123593610ad27e58.tar.gz
We will attempt to generate Atom feeds "by hand" as the
XML::Atom::SimpleFeed API does not support streaming output.
Since email is large and servers are small, this should prevent
wasting memory when we generate larger feeds.

Of course, we hope clients use SAX parsers capable of handling
large streams without slurping.
Diffstat (limited to 't/html_index.t')
-rw-r--r--t/html_index.t14
1 files changed, 2 insertions, 12 deletions
diff --git a/t/html_index.t b/t/html_index.t
index 6286fc47..73311f65 100644
--- a/t/html_index.t
+++ b/t/html_index.t
@@ -55,18 +55,8 @@ EOF
                 git_dir => $git_dir,
                 max => 3
         });
-        my $headers;
-        my $io = IO::File->new_tmpfile;
-        use POSIX qw/dup/;
-        my $dup = dup($io->fileno);
-        my $response = sub { $headers = \@_, $io };
-        $cb->($response);
-        $io = IO::File->new;
-        $io->fdopen($dup, 'r+');
-        $io->seek(0, 0);
-        $io->read(my $feed, 666666);
-        like($feed, qr/html/, "feed is valid HTML :)");
-        $io->close;
+        require 't/common.perl';
+        like(stream_to_string($cb), qr/html/, "feed is valid HTML :)");
 }
 
 done_testing();