#!perl
BEGIN {
chdir
't'
if
-d
't'
;
@INC
=
"../lib"
;
}
require
'./test.pl'
;
$ENV
{PERL_TEST_MEMORY} >= 2
or skip_all(
"Need ~2GB for this test"
);
$Config
{ptrsize} >= 8
or skip_all(
"Need 64-bit pointers for this test"
);
plan(
tests
=> 4);
my
$space
=
" "
;
my
$work
=
$space
x 0x80000002;
substr
(
$work
, 0x80000000) =
"\n\n"
;
is(
index
(
$work
,
"\n"
), 0x80000000,
"test index() over 2G mark"
);
is(
rindex
(
$work
,
"\n"
), 0x80000001,
"test rindex() over 2G mark"
);
utf8::upgrade(
$work
);
is(
index
(
$work
,
"\n"
), 0x80000000,
"test index() over 2G mark (utf8-ish)"
);
is(
rindex
(
$work
,
"\n"
), 0x80000001,
"test rindex() over 2G mark (utf8-ish)"
);