use strict; use warnings FATAL => 'all'; use Apache::Test; use Apache::TestRequest; # this is a test to see if our # buffer logic works when our filter # sends data to HTML::Clean in chunks. plan tests => 4, have_lwp; # is 8 characters long # our buffer is 1024 characters # so 1016 characters plus should # pass exactly one buffer to our filter my $response = GET '/long?1016'; chomp(my $content = $response->content); ok($content eq ('x' x 1016) . ''); # now the tag is broken when fed to # HTML::Clean - make sure our buffer breaks # the line properly so we don't end up # with $response = GET '/long?1017'; chomp($content = $response->content); ok($content eq ('x' x 1017) . ''); # the last test was content); ok($content eq ('x' x 1023) . ''); # now we're fully into the second buffer $response = GET '/long?1024'; chomp($content = $response->content); ok($content eq ('x' x 1024) . '');