summaryrefslogtreecommitdiff
path: root/t/base
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-06-20 18:58:06 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-20 18:58:06 +0000
commitce29ac451034df067115e81c1d12f5f8c0114302 (patch)
treeae84408029763d15a24d1d491b023c0096ace1af /t/base
parentff5ad48a406d02420ef1036954fc4b1323a7f781 (diff)
downloadperl-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/base')
-rwxr-xr-xt/base/lex.t17
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;