summaryrefslogtreecommitdiff
path: root/t/uni
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2013-03-14 21:05:23 -0300
committerKarl Williamson <public@khwilliamson.com>2013-03-15 13:48:41 -0600
commita21046adfc98d4af022406a8e4bb48fecec7749c (patch)
treef47e2a6dd54c8e22d17b88959d0f4a0da9412bdc /t/uni
parent1bd59f2c8b61c62045c3168ba7470136f276702d (diff)
downloadperl-a21046adfc98d4af022406a8e4bb48fecec7749c.tar.gz
toke.c, S_scan_ident: Ignore whitespace on both sides of ${ ... }
${ var } (and ${ \7LOBAL_PHASE}) were broken by 32833930e. However, it turns out that the behavior prior to that commit was already strange: ${ .}; # Legal ${. }; # Illegal ${ . }; # Illegal ${ \7LOBAL_PHASE}; # Legal ${ ^GLOBAL_PHASE}; # Illegal ${^GLOBAL_PHASE }; # Illegal This commit restores ${ var } and makes all of the above work by always ignoring spaces on both sides of ${ ... }.
Diffstat (limited to 't/uni')
-rw-r--r--t/uni/variables.t28
1 files changed, 27 insertions, 1 deletions
diff --git a/t/uni/variables.t b/t/uni/variables.t
index 9a469d6e42..cee681fd08 100644
--- a/t/uni/variables.t
+++ b/t/uni/variables.t
@@ -12,7 +12,7 @@ use utf8;
use open qw( :utf8 :std );
no warnings qw(misc reserved);
-plan (tests => 65856);
+plan (tests => 65869);
# ${single:colon} should not be valid syntax
{
@@ -201,3 +201,29 @@ EOP
);
}
}
+
+{
+ # bleadperl v5.17.9-109-g3283393 breaks JEREMY/File-Signature-1.009.tar.gz
+ # https://rt.perl.org/rt3/Ticket/Display.html?id=117145
+ local $@;
+ my $var = 10;
+ eval ' ${ var }';
+
+ is(
+ $@,
+ '',
+ '${ var } works under strict'
+ );
+
+ {
+ no strict;
+ for my $var ( '$', "\7LOBAL_PHASE", "^GLOBAL_PHASE", "^V" ) {
+ eval "\${ $var}";
+ is($@, '', "\${ $var} works" );
+ eval "\${$var }";
+ is($@, '', "\${$var } works" );
+ eval "\${ $var }";
+ is($@, '', "\${ $var } works" );
+ }
+ }
+}