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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#!perl
BEGIN {
chdir 't' if -d 't';
@INC = "../lib";
}
use strict;
require './test.pl';
use Config qw(%Config);
# 2 for the child, 2 for the parent
$ENV{PERL_TEST_MEMORY} >= 4
or skip_all("Need ~4Gb for this test");
$Config{ptrsize} >= 8
or skip_all("Need 64-bit pointers for this test");
{
# https://www.perlmonks.org/?node_id=11161665
my $x = `$^X -e "print q/x/ x 0x80000000"`;
is(length $x, 0x80000000, "check entire input read");
undef $x;
}
{
# sv_gets_append_to_utf8 append parameter
my $x = "x";
$x x= 0x8000_0000;
utf8::upgrade($x);
# using bareword handle because the rcatline optimization isn't done
# for non-barewords
# for $fh
# we chdired to "t"
open FH, "<", "TEST" or die $!;
$x .= <FH>;
pass("didn't crash appending readline to large upgraded scalar");
}
{
# sv_gets_read_record append parameter
my $x = "x";
$x x= 0x8000_0000;
open FH, "<", "TEST" or die $!;
local $/ = \100;
$x .= <FH>;
pass("didn't crash appending readline record to large scalar");
}
done_testing();
|