]> Sergey Matveev's repositories - public-inbox.git/blob - t/common.perl
1251333d8a7145f4f80b983a5a2705e8ef34f044
[public-inbox.git] / t / common.perl
1 # Copyright (C) 2015 all contributors <meta@public-inbox.org>
2 # License: AGPLv3 or later (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;