]> Sergey Matveev's repositories - public-inbox.git/blob - t/common.perl
public-inbox 1.1.0-pre1
[public-inbox.git] / t / common.perl
1 # Copyright (C) 2015-2018 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3
4 sub stream_to_string {
5         my ($res) = @_;
6         my $body = $res->[2];
7         my $str = '';
8         while (defined(my $chunk = $body->getline)) {
9                 $str .= $chunk;
10         }
11         $body->close;
12         $str;
13 }
14
15 1;