From e9d2327de9f57c23ca9f4b2b17818e696b0b031e Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Mon, 24 Sep 2012 18:18:42 -0700 Subject: [perl #56880] Allow v10 as a label or package name --- t/base/lex.t | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 't/base') 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"; -- cgit v1.2.1