]> git.vpit.fr Git - perl/modules/subs-auto.git/commitdiff
Explicitely test hash keys
authorVincent Pit <vince@profvince.com>
Thu, 2 Oct 2008 20:19:35 +0000 (22:19 +0200)
committerVincent Pit <vince@profvince.com>
Thu, 2 Oct 2008 20:19:35 +0000 (22:19 +0200)
t/10-base.t

index bd1050efd0d36983a8cf39c1f32e90bd708c7d65..c4675c41a374441ee20a98e474d1896c36faaf77 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
 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]/ },
 
 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');
 
 eval { strict->import };
 is($strict, 1, 'the strict subroutine was called');
 
+# Test hash keys
+my $c = 0;
 my %h = (
  a => 5,
  b => 7,
 );
 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;
 
 my $foo;
 our @foo;