From: Jesse Vincent Date: Wed, 25 Nov 2009 18:47:38 +0000 (-0500) Subject: Moved the original test file from the previous patch into t/op/lex.t, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bc795616b74a72425cddf467dbdc6e65bc76484b;p=p5sagit%2Fp5-mst-13.2.git Moved the original test file from the previous patch into t/op/lex.t, Aded details on the bug it fixes to the tests. --- diff --git a/MANIFEST b/MANIFEST index a8f80ed..bc4460d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -4234,7 +4234,6 @@ t/io/tell.t See if file seeking works t/io/through.t See if pipe passes data intact t/io/utf8.t See if file seeking works t/japh/abigail.t Obscure tests -t/comp/interpolate.t See if interpolating strings work t/lib/1_compile.t See if the various libraries and extensions compile t/lib/Cname.pm Test charnames in regexes (op/pat.t) t/lib/common.pl Helper for lib/{warnings,feature}.t diff --git a/t/comp/interpolate.t b/t/comp/interpolate.t deleted file mode 100644 index 3472d97..0000000 --- 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 3f00248..0789077 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. +# + +} +