diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:49:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:49:40 +0000 |
commit | c96f16e8103783f6b98d9f844ea3a7f2195e4834 (patch) | |
tree | 479bef5e7eb5d4f04ba171931c8b47335734e161 /debian/vendor-h2o/misc/p5-net-fastcgi/t/020_protocol/027_begin_request.t | |
parent | Merging upstream version 1.9.4. (diff) | |
download | dnsdist-debian/1.9.4-1.tar.xz dnsdist-debian/1.9.4-1.zip |
Adding debian version 1.9.4-1.debian/1.9.4-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/vendor-h2o/misc/p5-net-fastcgi/t/020_protocol/027_begin_request.t')
-rw-r--r-- | debian/vendor-h2o/misc/p5-net-fastcgi/t/020_protocol/027_begin_request.t | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/debian/vendor-h2o/misc/p5-net-fastcgi/t/020_protocol/027_begin_request.t b/debian/vendor-h2o/misc/p5-net-fastcgi/t/020_protocol/027_begin_request.t deleted file mode 100644 index e5d6c91..0000000 --- a/debian/vendor-h2o/misc/p5-net-fastcgi/t/020_protocol/027_begin_request.t +++ /dev/null @@ -1,97 +0,0 @@ -#!perl - -use strict; -use warnings; - -use lib 't/lib', 'lib'; -use myconfig; - -use Test::More tests => 15; -use Test::HexString; -use Test::Exception; - -BEGIN { - use_ok('Net::FastCGI::Protocol', qw[ build_begin_request ]); - use_ok('Net::FastCGI::Constant', qw[ :type :role ]); -} - -{ - my $begin = "\x01\x01\x00\x01\x00\x08\x00\x00" # FCGI_Header id=1 - . "\x00\x01\x00\x00\x00\x00\x00\x00"; # FCGI_BeginRequestBody role=FCGI_RESPONDER - - my $params = "\x01\x04\x00\x01\x00\x00\x00\x00"; # FCGI_Header type=FCGI_PARAMS - - { - my $exp = $begin . $params; - my $got = build_begin_request(1, FCGI_RESPONDER, 0, {}); - is_hexstr($got, $exp, q<build_begin_request(1, FCGI_RESPONDER, 0, {})>); - } - - my $stdin = "\x01\x05\x00\x01\x00\x00\x00\x00"; # FCGI_Header type=FCGI_STDIN - - { - my $exp = $begin . $params . $stdin; - my $got = build_begin_request(1, FCGI_RESPONDER, 0, {}, ''); - is_hexstr($got, $exp, q<build_begin_request(1, FCGI_RESPONDER, 0, {}, '')>); - } - - { - my $exp = $begin . $params . $stdin; - my $got = build_begin_request(1, FCGI_RESPONDER, 0, {}, undef); - is_hexstr($got, $exp, q<build_begin_request(1, FCGI_RESPONDER, 0, {}, undef)>); - } - - my $data = "\x01\x08\x00\x01\x00\x00\x00\x00"; # FCGI_Header type=FCGI_DATA - - { - my $exp = $begin . $params . $stdin . $data; - my $got = build_begin_request(1, FCGI_RESPONDER, 0, {}, '', undef); - is_hexstr($got, $exp, q<build_begin_request(1, FCGI_RESPONDER, 0, {}, '', undef)>); - } - - { - my $exp = $begin . $params . $stdin . $data; - my $got = build_begin_request(1, FCGI_RESPONDER, 0, {}, undef, ''); - is_hexstr($got, $exp, q<build_begin_request(1, FCGI_RESPONDER, 0, {}, undef, '')>); - } -} - -{ - my $begin = "\x01\x01\x00\x01\x00\x08\x00\x00" # FCGI_Header id=1 - . "\x00\x01\x00\x00\x00\x00\x00\x00"; # FCGI_BeginRequestBody role=FCGI_RESPONDER - - my $params = "\x01\x04\x00\x01\x00\x08\x00\x00" # FCGI_Header type=FCGI_PARAMS - . "\x03\x03FooBar" - . "\x01\x04\x00\x01\x00\x00\x00\x00"; - - { - my $exp = $begin . $params; - my $got = build_begin_request(1, FCGI_RESPONDER, 0, { Foo => 'Bar' }); - is_hexstr($got, $exp, q!build_begin_request(1, FCGI_RESPONDER, 0, { Foo => 'Bar' })!); - } - - my $stdin = "\x01\x05\x00\x01\x03\xFC\x04\x00" # FCGI_Header type=FCGI_STDIN - . "x" x 1020 . "\0" x 4 - . "\x01\x05\x00\x01\x00\x00\x00\x00"; - { - my $exp = $begin . $params . $stdin; - my $got = build_begin_request(1, FCGI_RESPONDER, 0, { Foo => 'Bar' }, 'x' x 1020); - is_hexstr($got, $exp, q!build_begin_request(1, FCGI_RESPONDER, 0, { Foo => 'Bar' }, 'x' x 1020)!); - } - - my $data = "\x01\x08\x00\x01\x04\x00\x00\x00" # FCGI_Header type=FCGI_DATA - . "y" x 1024 - . "\x01\x08\x00\x01\x00\x00\x00\x00"; - - { - my $exp = $begin . $params . $stdin . $data; - my $got = build_begin_request(1, FCGI_RESPONDER, 0, { Foo => 'Bar' }, 'x' x 1020, 'y' x 1024); - is_hexstr($got, $exp, q!build_begin_request(1, FCGI_RESPONDER, 0, { Foo => 'Bar' }, 'x' x 1020, 'y' x 1024)!); - } -} - -# build_begin_request(request_id, role, flags, params [, stdin [, data]]) -for (0..3, 7) { - throws_ok { build_begin_request((1) x $_) } qr/^Usage: /; -} - |