summaryrefslogtreecommitdiff
path: root/t/base
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-09-24 18:18:42 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-09-25 06:27:55 -0700
commite9d2327de9f57c23ca9f4b2b17818e696b0b031e (patch)
tree8602bc5cfd9169c1fd7729b6aaabaea81f2aa610 /t/base
parent7ce06b7dca2247fac16c28cd064f3949998cb06e (diff)
downloadperl-e9d2327de9f57c23ca9f4b2b17818e696b0b031e.tar.gz
[perl #56880] Allow v10 as a label or package name
Diffstat (limited to 't/base')
-rw-r--r--t/base/lex.t22
1 files changed, 21 insertions, 1 deletions
diff --git a/t/base/lex.t b/t/base/lex.t
index bca43b4570..b1c4a09992 100644
--- a/t/base/lex.t
+++ b/t/base/lex.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..81\n";
+print "1..85\n";
$x = 'x';
@@ -380,3 +380,23 @@ for(qw< require goto last next redo dump >) {
print "ok ", $test++, " - [perl #105924] $_ WORD << ...\n";
print "# $@" if $@;
}
+
+# http://rt.perl.org/rt3/Ticket/Display.html?id=56880
+my $counter = 0;
+eval 'v23: $counter++; goto v23 unless $counter == 2';
+print "not " unless $counter == 2;
+print "ok 82 - Use v[0-9]+ as a label\n";
+$counter = 0;
+eval 'v23 : $counter++; goto v23 unless $counter == 2';
+print "not " unless $counter == 2;
+print "ok 83 - Use v[0-9]+ as a label with space before colon\n";
+
+my $output = "";
+eval "package v10::foo; sub test2 { return 'v10::foo' }
+ package v10; sub test { return v10::foo::test2(); }
+ package main; \$output = v10::test(); ";
+print "not " unless $output eq 'v10::foo';
+print "ok 84 - call a function in package v10::foo\n";
+
+print "not " unless (1?v65:"bar") eq 'A';
+print "ok 85 - colon detection after vstring does not break ? vstring :\n";