This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add a test for bug #17920, and a new test file for it.
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 21 Nov 2002 20:49:36 +0000 (20:49 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 21 Nov 2002 20:49:36 +0000 (20:49 +0000)
p4raw-id: //depot/perl@18169

MANIFEST
t/comp/parser.t [new file with mode: 0644]

index aee5fa4..be029d0 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -2365,6 +2365,7 @@ t/comp/hints.t                    See if %^H works
 t/comp/multiline.t             See if multiline strings work
 t/comp/our.t                   Tests for our declaration
 t/comp/package.t               See if packages work
+t/comp/parser.t                        See if the parser works in edge cases
 t/comp/proto.t                 See if function prototypes work
 t/comp/redef.t                 See if we get correct warnings on redefined subs
 t/comp/require.t               See if require works
diff --git a/t/comp/parser.t b/t/comp/parser.t
new file mode 100644 (file)
index 0000000..26f9c4e
--- /dev/null
@@ -0,0 +1,15 @@
+#!./perl
+
+# Checks if the parser behaves correctly in edge cases
+# (including weird syntax errors)
+
+BEGIN {
+    chdir 't' if -d 't';
+    @INC = '../lib';
+}
+
+print "1..1\n";
+
+# This used to dump core (bug #17920)
+eval q{ sub { sub { f1(f2();); my($a,$b,$c) } } };
+print $@ && $@ =~ /error/ ? "ok 1\n" : "not ok 1\n";