From: Vincent Pit Date: Thu, 2 Oct 2008 20:19:35 +0000 (+0200) Subject: Explicitely test hash keys X-Git-Tag: v0.04~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=135d32c6d26ab5475a9ef65f699f90f1d7fef57a;p=perl%2Fmodules%2Fsubs-auto.git Explicitely test hash keys --- diff --git a/t/10-base.t b/t/10-base.t index bd1050e..c4675c4 100644 --- a/t/10-base.t +++ b/t/10-base.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 91; +use Test::More tests => 92; my %_re = ( bareword => sub { qr/^Bareword\s+['"]?\s*$_[0]\s*['"]?\s+not\s+allowed\s+while\s+["']?\s*strict\s+subs\s*['"]?\s+in\s+use\s+at\s+$_[1]\s+line\s+$_[2]/ }, @@ -80,10 +80,15 @@ sub strict { $strict = 1; undef } eval { strict->import }; is($strict, 1, 'the strict subroutine was called'); +# Test hash keys +my $c = 0; my %h = ( a => 5, b => 7, ); +sub a { ++$c } +sub b { ++$c } +is($c, 0, "hash keys shouldn't be converted"); my $foo; our @foo;