# Check that PL_sigwarn's reference count is correct, and that
# &PerlIO::Layer::NoWarnings isn't prematurely freed.
- fresh_perl_like (<<"EOT", qr/^CODE/);
+ fresh_perl_like (<<"EOT", qr/^CODE/, {}, "Check PL_sigwarn's reference count");
open(UTF, "<:raw:encoding(utf8)", '$afile') or die \$!;
print ref *PerlIO::Layer::NoWarnings{CODE};
EOT
'$_ = q-strict.pm-; 1 ? require : die;'
.' print qq-ok\n- if $INC{q-strict.pm-}',
"ok\n",
+ {},
'foo ? require : bar [perl #128307]'
);
'no crash when deleting $::{INC} in thread'
);
-fresh_perl_is(<<'CODE', 'ok', 'no crash modifying extended array element');
+fresh_perl_is(<<'CODE', 'ok', {}, 'no crash modifying extended array element');
use threads;
my @a = 1;
threads->create(sub { $#a = 1; $a[1] = 2; print qq/ok\n/ })->join;
# rt.perl.org 36622. Perl didn't like a y/// at end of file. No trailing
# newline allowed.
-fresh_perl_is(q[$_ = "foo"; y/A-Z/a-z/], '');
+fresh_perl_is(q[$_ = "foo"; y/A-Z/a-z/], '', {}, 'RT #36622 y/// at end of file');
{ # [perl #38293] chr(65535) should be allowed in regexes
# returned, with $? set to the exit code. Unless overridden, stderr is
# redirected to stdout.
+ die sprintf "Third argument to fresh_perl_.* must be hashref of args to fresh_perl (or {})"
+ unless !(defined $runperl_args) || ref($runperl_args) eq 'HASH';
+
# Given the choice of the mis-parsable {}
# (we want an anon hash, but a borked lexer might think that it's a block)
# or relying on taking a reference to a lexical