1
package TestApache::read2;
3
# extra tests in addition to TestApache::read
6
use warnings FATAL => 'all';
8
use Apache2::RequestRec ();
9
use Apache2::RequestIO ();
15
use Apache2::Const -compile => qw(OK);
17
my $expected = "foobar";
24
# test the case where the buffer to be filled has set magic
25
# attached. which is the case when one passes an non-existing hash
26
# entry value. it's not autovivified when passed to the function
27
# and it's not undef. running SetMAGIC inside read accomplishes
28
# the autovivication in this particular case.
30
my $len = $r->read($data->{buffer}, $r->headers_in->{'Content-Length'});
32
ok t_cmp($data->{buffer},
34
"reading into an autovivified hash entry");