summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/t/base/lex.t
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/t/base/lex.t')
-rwxr-xr-xcontrib/perl5/t/base/lex.t31
1 files changed, 28 insertions, 3 deletions
diff --git a/contrib/perl5/t/base/lex.t b/contrib/perl5/t/base/lex.t
index 045cb22..8e2452d 100755
--- a/contrib/perl5/t/base/lex.t
+++ b/contrib/perl5/t/base/lex.t
@@ -1,8 +1,6 @@
#!./perl
-# $RCSfile: lex.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:04 $
-
-print "1..30\n";
+print "1..35\n";
$x = 'x';
@@ -117,3 +115,30 @@ $foo =~ s/^not /substr(<<EOF, 0, 0)/e;
Ignored
EOF
print $foo;
+
+# see if eval '', s///e, and heredocs mix
+
+sub T {
+ my ($where, $num) = @_;
+ my ($p,$f,$l) = caller;
+ print "# $p:$f:$l vs /$where/\nnot " unless "$p:$f:$l" =~ /$where/;
+ print "ok $num\n";
+}
+
+my $test = 31;
+
+{
+# line 42 "plink"
+ local $_ = "not ok ";
+ eval q{
+ s/^not /<<EOT/e and T '^main:\(eval \d+\):2$', $test++;
+# fuggedaboudit
+EOT
+ print $_, $test++, "\n";
+ T('^main:\(eval \d+\):6$', $test++);
+# line 1 "plunk"
+ T('^main:plunk:1$', $test++);
+ };
+ print "# $@\nnot ok $test\n" if $@;
+ T '^main:plink:53$', $test++;
+}
OpenPOWER on IntegriCloud