b8876f
From d7186addd1b477f6bdcef5e9d24f2125691a9082 Mon Sep 17 00:00:00 2001
b8876f
From: Hugo van der Sanden <hv@crypt.org>
b8876f
Date: Sun, 19 Feb 2017 11:15:38 +0000
b8876f
Subject: [PATCH] [perl #130814] Add testcase, and new testfile
b8876f
 t/comp/parser_run.t
b8876f
MIME-Version: 1.0
b8876f
Content-Type: text/plain; charset=UTF-8
b8876f
Content-Transfer-Encoding: 8bit
b8876f
b8876f
Sometimes it's useful to have test.pl around, but it seems inappropriate
b8876f
to pollute the existing t/comp/parser.t with that.
b8876f
b8876f
Signed-off-by: Petr Písař <ppisar@redhat.com>
b8876f
---
b8876f
 t/comp/parser_run.t | 28 ++++++++++++++++++++++++++++
b8876f
 1 file changed, 28 insertions(+)
b8876f
 create mode 100644 t/comp/parser_run.t
b8876f
b8876f
diff --git a/t/comp/parser_run.t b/t/comp/parser_run.t
b8876f
new file mode 100644
b8876f
index 0000000..2543f49
b8876f
--- /dev/null
b8876f
+++ b/t/comp/parser_run.t
b8876f
@@ -0,0 +1,28 @@
b8876f
+#!./perl
b8876f
+
b8876f
+# Parser tests that want test.pl, eg to use runperl() for tests to show
b8876f
+# reads through invalid pointers.
b8876f
+# Note that this should still be runnable under miniperl.
b8876f
+
b8876f
+BEGIN {
b8876f
+    @INC = qw(. ../lib );
b8876f
+    chdir 't' if -d 't';
b8876f
+}
b8876f
+
b8876f
+require './test.pl';
b8876f
+plan(1);
b8876f
+
b8876f
+# [perl #130814] can reallocate lineptr while looking ahead for
b8876f
+# "Missing $ on loop variable" diagnostic.
b8876f
+my $result = runperl(
b8876f
+    prog => " foreach m0\n\$" . ("0" x 0x2000),
b8876f
+    stderr => 1,
b8876f
+);
b8876f
+is($result, <
b8876f
+syntax error at -e line 3, near "foreach m0
b8876f
+"
b8876f
+Identifier too long at -e line 3.
b8876f
+EXPECT
b8876f
+
b8876f
+__END__
b8876f
+# ex: set ts=8 sts=4 sw=4 et:
b8876f
-- 
b8876f
2.7.4
b8876f