summaryrefslogtreecommitdiff
path: root/t/comp
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2013-02-26 20:07:41 -0300
committerNicholas Clark <nick@ccl4.org>2013-06-11 15:03:46 +0200
commita20e6aaed858bacbfb2592e4d1ac5c0d3983de0c (patch)
treea7c4660ba6052e5cfaefa1c56f5961dc5754bdb2 /t/comp
parentd82e2a6d8f2cc6469125270842b1e69ea0d72831 (diff)
downloadperl-a20e6aaed858bacbfb2592e4d1ac5c0d3983de0c.tar.gz
Test that C<format 'Foo> is identical to C<format Foo>
When declaring a format, using a leading package separator requires careful handling in the parser, to avoid confusion with a subroutine of the same name.
Diffstat (limited to 't/comp')
-rw-r--r--t/comp/parser.t14
1 files changed, 13 insertions, 1 deletions
diff --git a/t/comp/parser.t b/t/comp/parser.t
index 7c0db7fa37..6002b3acf7 100644
--- a/t/comp/parser.t
+++ b/t/comp/parser.t
@@ -3,7 +3,7 @@
# Checks if the parser behaves correctly in edge cases
# (including weird syntax errors)
-print "1..154\n";
+print "1..155\n";
sub failed {
my ($got, $expected, $name) = @_;
@@ -450,6 +450,18 @@ for my $pkg(()){}
$pkg = 3;
is $pkg, 3, '[perl #114942] for my $foo()){} $foo';
+# Check that format 'Foo still works after removing the hack from
+# force_word
+$test++;
+format 'one =
+ok @<< - format 'foo still works
+$test
+.
+{
+ local $~ = "one";
+ write();
+}
+
# Add new tests HERE (above this line)
# bug #74022: Loop on characters in \p{OtherIDContinue}