diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 06:33:51 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 06:33:51 +0000 |
commit | 4f0770f3df78ecd5dcaefbd214f7a1415366bca6 (patch) | |
tree | 72661b8f81594b855bcc967b819263f63fa30e17 /debian/perl-framework/t/modules/buffer.t | |
parent | Adding upstream version 2.4.56. (diff) | |
download | apache2-4f0770f3df78ecd5dcaefbd214f7a1415366bca6.tar.xz apache2-4f0770f3df78ecd5dcaefbd214f7a1415366bca6.zip |
Adding debian version 2.4.56-1~deb11u2.debian/2.4.56-1_deb11u2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/perl-framework/t/modules/buffer.t')
-rw-r--r-- | debian/perl-framework/t/modules/buffer.t | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/debian/perl-framework/t/modules/buffer.t b/debian/perl-framework/t/modules/buffer.t new file mode 100644 index 0000000..e508f37 --- /dev/null +++ b/debian/perl-framework/t/modules/buffer.t @@ -0,0 +1,38 @@ +use strict; +use warnings FATAL => 'all'; + +use Apache::Test; +use Apache::TestUtil; +use Apache::TestRequest; + +my @testcases = ( + ['/apache/buffer_in/', 'foo'], + ['/apache/buffer_out/', 'foo'], + ['/apache/buffer_in_out/', 'foo'], +); + +plan tests => scalar @testcases * 4, need 'mod_reflector', 'mod_buffer'; + +foreach my $t (@testcases) { + ## Small query ## + my $r = POST($t->[0], content => $t->[1]); + + # Checking for return code + ok t_cmp($r->code, 200, "Checking return code is '200'"); + # Checking for content + ok t_is_equal($r->content, $t->[1]); + + ## Big query ## + # 'foo' is 3 bytes, so 'foo' x 1000000 is ~3M, which is way over the default 'BufferSize' + ### FIXME - testing with to x 10000 is confusing LWP's full-duplex + ### handling: https://github.com/libwww-perl/libwww-perl/issues/299 + ### throttled down to a size which seems to work reliably for now + my $bigsize = 100000; + + $r = POST($t->[0], content => $t->[1] x $bigsize); + + # Checking for return code + ok t_cmp($r->code, 200, "Checking return code is '200'"); + # Checking for content + ok t_is_equal($r->content, $t->[1] x $bigsize); +} |