diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-20 18:58:06 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-20 18:58:06 +0000 |
commit | ce29ac451034df067115e81c1d12f5f8c0114302 (patch) | |
tree | ae84408029763d15a24d1d491b023c0096ace1af /t | |
parent | ff5ad48a406d02420ef1036954fc4b1323a7f781 (diff) | |
download | perl-ce29ac451034df067115e81c1d12f5f8c0114302.tar.gz |
Fix for ID 20010619.002 "When building hash, hash keys that
are function calls are not being called", from Abhijit.
p4raw-id: //depot/perl@10763
Diffstat (limited to 't')
-rwxr-xr-x | t/base/lex.t | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/t/base/lex.t b/t/base/lex.t index c7fb0e4cf3..4df4954733 100755 --- a/t/base/lex.t +++ b/t/base/lex.t @@ -1,6 +1,6 @@ #!./perl -print "1..51\n"; +print "1..54\n"; $x = 'x'; @@ -245,3 +245,18 @@ EOT print "ok $test\n"; ++$test; } + +# Tests 52-54 +# => should only quote foo::bar if it isn't a real sub. AMS, 20010621 + +sub xyz::foo { "bar" } +my %str = ( + foo => 1, + xyz::foo => 1, + xyz::bar => 1, +); + +my $test = 52; +print ((exists $str{foo} ? "" : "not ")."ok $test\n"); ++$test; +print ((exists $str{bar} ? "" : "not ")."ok $test\n"); ++$test; +print ((exists $str{xyz::bar} ? "" : "not ")."ok $test\n"); ++$test; |