diff options
Diffstat (limited to 't')
-rw-r--r-- | t/common.perl | 11 | ||||
-rw-r--r-- | t/feed.t | 9 |
2 files changed, 8 insertions, 12 deletions
diff --git a/t/common.perl b/t/common.perl index ccc7be46..053a935a 100644 --- a/t/common.perl +++ b/t/common.perl @@ -7,17 +7,6 @@ use strict; use warnings; use IO::Socket::INET; -sub stream_to_string { - my ($res) = @_; - my $body = $res->[2]; - my $str = ''; - while (defined(my $chunk = $body->getline)) { - $str .= $chunk; - } - $body->close; - $str; -} - sub tcp_server () { IO::Socket::INET->new( LocalAddr => '127.0.0.1', @@ -14,7 +14,14 @@ my $have_xml_feed = eval { require XML::Feed; 1 }; require './t/common.perl'; sub string_feed { - stream_to_string(PublicInbox::Feed::generate($_[0])); + my $res = PublicInbox::Feed::generate($_[0]); + my $body = $res->[2]; + my $str = ''; + while (defined(my $chunk = $body->getline)) { + $str .= $chunk; + } + $body->close; + $str; } my $tmpdir = tempdir('pi-feed-XXXXXX', TMPDIR => 1, CLEANUP => 1); |