diff options
author | Eric Wong <e@80x24.org> | 2015-08-22 00:06:45 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-08-22 01:57:35 +0000 |
commit | 1704bdb4aabdbc155eb962edf51498f59b65c839 (patch) | |
tree | 6f88e2d1662a99062b0ebd74d94f7bd7c0db56e6 /t | |
parent | 62395935e7bdd8e67776ebb9018f4633e67ff081 (diff) | |
download | public-inbox-1704bdb4aabdbc155eb962edf51498f59b65c839.tar.gz |
This should allow progressive rendering on the client and reduce memory usage on the server. Unfortunately XML::Atom::SimpleFeed does not yet support streaming, so we may not use it in the future.
Diffstat (limited to 't')
-rw-r--r-- | t/html_index.t | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/t/html_index.t b/t/html_index.t index 690368f1..6286fc47 100644 --- a/t/html_index.t +++ b/t/html_index.t @@ -50,11 +50,23 @@ EOF # check HTML index { - my $feed = PublicInbox::Feed->generate_html_index({ + use IO::File; + my $cb = PublicInbox::Feed::generate_html_index({ 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; } done_testing(); |