File: 06_big_post.t

package info (click to toggle)
libfcgi-client-perl 0.09-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 232 kB
  • sloc: ruby: 510; perl: 408; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 725 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use strict;
use warnings;
use Test::More;
use lib 't/lib/';
use t::Internal;

my $client = t::Internal->new(path => 't/fcgi/big_post.fcgi');

for my $len (85_556, 1_000_000) {
    my $chunk = "abcdefg" x $len;
    my ( $stdout, $stderr ) = $client->request(
        +{
            REQUEST_METHOD => 'GET',
            QUERY_STRING   => 'foo=bar',
            CONTENT_TYPE => 'application/octet-stream',
            CONTENT_LENGTH => length($chunk),
        },
        $chunk,
        10
    );
    is $stdout, "Content−Type: application/octet-stream\r\nContent-Length: @{[ length($chunk) ]}\r\n\r\n$chunk";
    my ($x1, $x2) = $stderr =~ /len: (\d+), (\d+)\n/;
    is $x1, $x2;
    is $x1, length($chunk);
}

done_testing;