summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJesse Vincent <jesse@bestpractical.com>2009-11-25 13:47:38 -0500
committerJesse Vincent <jesse@bestpractical.com>2009-11-25 14:31:28 -0500
commitbc795616b74a72425cddf467dbdc6e65bc76484b (patch)
treebaa03f0616085ee8d18544d9b2d78e0e4539ce3b /t
parentf706d24c20941a6401e90643488acaa0705ba877 (diff)
downloadperl-bc795616b74a72425cddf467dbdc6e65bc76484b.tar.gz
Moved the original test file from the previous patch into t/op/lex.t,
Aded details on the bug it fixes to the tests.
Diffstat (limited to 't')
-rw-r--r--t/comp/interpolate.t15
-rw-r--r--t/op/lex.t29
2 files changed, 27 insertions, 17 deletions
diff --git a/t/comp/interpolate.t b/t/comp/interpolate.t
deleted file mode 100644
index 3472d97cf1..0000000000
--- a/t/comp/interpolate.t
+++ /dev/null
@@ -1,15 +0,0 @@
-BEGIN {
- require "test.pl"
-}
-
-use strict;
-use warnings;
-
-plan 2;
-
-{
- my %foo = (aap => "monkey");
- my $foo = '';
- is("@{[$foo{'aap'}]}", 'monkey', 'interpolation of hash lookup with space between lexical variable and subscript');
- is("@{[$foo {'aap'}]}", 'monkey', 'interpolation of hash lookup with space between lexical variable and subscript');
-}
diff --git a/t/op/lex.t b/t/op/lex.t
index 3f00248ae5..0789077b5c 100644
--- a/t/op/lex.t
+++ b/t/op/lex.t
@@ -1,9 +1,10 @@
-#!perl -w
+#!perl
use strict;
+use warnings;
require './test.pl';
-plan(tests => 2);
+plan(tests => 4);
{
no warnings 'deprecated';
@@ -20,3 +21,27 @@ $yow
}
curr_test(3);
+
+
+{
+ my %foo = (aap => "monkey");
+ my $foo = '';
+ is("@{[$foo{'aap'}]}", 'monkey', 'interpolation of hash lookup with space between lexical variable and subscript');
+ is("@{[$foo {'aap'}]}", 'monkey', 'interpolation of hash lookup with space between lexical variable and subscript - test for [perl #70091]');
+
+# Original bug report [perl #70091]
+# #!perl
+# use warnings;
+# my %foo;
+# my $foo = '';
+# (my $tmp = $foo) =~ s/^/$foo {$0}/e;
+# __END__
+#
+# This program causes a segfault with 5.10.0 and 5.10.1.
+#
+# The space between '$foo' and '{' is essential, which is why piping
+# it through perl -MO=Deparse "fixes" it.
+#
+
+}
+