summaryrefslogtreecommitdiff
path: root/t/comp/parser.t
diff options
context:
space:
mode:
authorAdrian M. Enache <enache@rdslink.ro>2003-02-13 06:52:21 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-02-19 20:55:09 +0000
commit7df0d0422c26edcc954b82bd79e461b99b3c4092 (patch)
tree5431632cfc3961abf098a51dd59a5c6ce342fe31 /t/comp/parser.t
parentfe581ec7e70f830119f2a196166efcfaafaf0a43 (diff)
downloadperl-7df0d0422c26edcc954b82bd79e461b99b3c4092.tar.gz
Re: [perl #20716] scope error with brackets
Message-ID: <20030213025221.GA1215@ratsnest.hole> (better version of change #18687) p4raw-link: @18687 on //depot/perl: 437fd2104756c25dedf68c6e31cd29ecbf0e2569 p4raw-id: //depot/perl@18753
Diffstat (limited to 't/comp/parser.t')
-rw-r--r--t/comp/parser.t26
1 files changed, 20 insertions, 6 deletions
diff --git a/t/comp/parser.t b/t/comp/parser.t
index 88f933c7a6..ad1c5b80bd 100644
--- a/t/comp/parser.t
+++ b/t/comp/parser.t
@@ -9,7 +9,7 @@ BEGIN {
}
require "./test.pl";
-plan( tests => 15 );
+plan( tests => 20 );
eval '%@x=0;';
like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' );
@@ -68,9 +68,23 @@ eval {
is( $@, '', 'PL_lex_brackstack' );
{
- undef $a;
- undef @b;
- my $a="a"; is("${a}{", "a{", "scope error #20716");
- my $a="a"; is("${a}[", "a[", "scope error #20716");
- my @b=("b"); is("@{b}{", "b{", "scope error #20716");
+ # tests for bug #20716
+ undef $a;
+ undef @b;
+ my $a="A";
+ is("${a}{", "A{", "interpolation, qq//");
+ is("${a}[", "A[", "interpolation, qq//");
+ my @b=("B");
+ is("@{b}{", "B{", "interpolation, qq//");
+ is(qr/${a}{/, '(?-xism:A{)', "interpolation, qr//");
+ my $c = "A{";
+ $c =~ /${a}{/;
+ is($&, 'A{', "interpolation, m//");
+ $c =~ s/${a}{/foo/;
+ is($c, 'foo', "interpolation, s/...//");
+ $c =~ s/foo/${a}{/;
+ is($c, 'A{', "interpolation, s//.../");
+ is(<<"${a}{", "A{ A[ B{\n", "interpolation, here doc");
+${a}{ ${a}[ @{b}{
+${a}{
}