summaryrefslogtreecommitdiff
path: root/t/uni
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2013-09-01 10:51:31 -0300
committerBrian Fraser <fraserbn@gmail.com>2013-09-18 05:23:31 -0300
commitf7bd557bec80998b7095160ef08c951066c9afe3 (patch)
tree793ab2eac73adc5a01abb069bad473d4ebf2fa2e /t/uni
parent6a4ad6add6856e87d5efc5b7266b147c8e68ba8f (diff)
downloadperl-f7bd557bec80998b7095160ef08c951066c9afe3.tar.gz
toke.c, S_scan_ident: Skip over newlines as well as spaces and tabs.
Not doing this lead to some bugs, such as 'eval "*{\nOIN}"' returning a glob for "\nOIN" rather than just "OIN", or 'eval "\${\cT\n}"' giving spurious syntax errors. Note however that this is not a full fix, since that latter test case still fails outside of an eval.
Diffstat (limited to 't/uni')
-rw-r--r--t/uni/variables.t23
1 files changed, 21 insertions, 2 deletions
diff --git a/t/uni/variables.t b/t/uni/variables.t
index cee681fd08..17bd4a845f 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 => 65869);
+plan (tests => 65873);
# ${single:colon} should not be valid syntax
{
@@ -202,7 +202,7 @@ 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 $@;
@@ -227,3 +227,22 @@ EOP
}
}
}
+
+{
+ is(
+ "".eval "*{\nOIN}",
+ "*main::OIN",
+ "Newlines at the start of an identifier should be skipped over"
+ );
+
+
+ is(
+ "".eval "*{^JOIN}",
+ "*main::\nOIN",
+ "...but \$^J is still legal"
+ );
+
+ my $ret = eval "\${\cT\n}";
+ is($@, "", 'No errors from using ${\n\cT\n}');
+ is($ret, $^T, "...and we got the right value");
+}