This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix t/comp/parser_run.t for EBCDIC
[perl5.git] / t / comp / parser_run.t
index a2cc27d..79b669d 100644 (file)
@@ -5,12 +5,12 @@
 # Note that this should still be runnable under miniperl.
 
 BEGIN {
-    @INC = qw(. ../lib );
     chdir 't' if -d 't';
+    require './test.pl';
+    set_up_inc( qw(. ../lib ) );
 }
 
-require './test.pl';
-plan(3);
+plan(5);
 
 # [perl #130814] can reallocate lineptr while looking ahead for
 # "Missing $ on loop variable" diagnostic.
@@ -25,10 +25,10 @@ Identifier too long at - line 3.
 EXPECT
 
 fresh_perl_is(<<EOS, <<'EXPECT', {}, "linestart before bufptr");
-\${ \xD5eeeeeeeeeeee
+\${ \xB6eeeeeeeeeeee
 'x
 EOS
-Unrecognized character \xD5; marked by <-- HERE after ${ <-- HERE near column 4 at - line 1.
+Unrecognized character \xB6; marked by <-- HERE after ${ <-- HERE near column 4 at - line 1.
 EXPECT
 
 fresh_perl_is(<<'EOS', <<'EXPECTED', {}, "use after free (#131836)");
@@ -39,5 +39,21 @@ syntax error at - line 1, at EOF
 Execution of - aborted due to compilation errors.
 EXPECTED
 
+SKIP:
+{
+    # [perl #131949] use after free
+    # detected by ASAN
+    # Win32 cmd.exe can't handle newlines well
+    skip("Need POSIXish", 1) if $^O eq "MSWin32";
+    my $out = runperl(prog => "\@{ 0\n\n}", stderr => 1, non_portable => 1);
+    is($out, "", "check for ASAN use after free");
+}
+
+fresh_perl_is('-C-', <<'EXPECTED', {}, "ambiguous unary operator check doesn't crash (#132433)");
+Warning: Use of "-C-" without parentheses is ambiguous at - line 1.
+syntax error at - line 1, at EOF
+Execution of - aborted due to compilation errors.
+EXPECTED
+
 __END__
 # ex: set ts=8 sts=4 sw=4 et: