This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
lexsub.t: Fix another test
authorFather Chrysostomos <sprout@cpan.org>
Mon, 9 Jul 2012 19:52:48 +0000 (12:52 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 16 Sep 2012 05:45:01 +0000 (22:45 -0700)
The problem with writing to-do tests is that it is very easy to get
the tests wrong, such that they continue to fail even when the prob-
lems they test for are fixed.

t/cmd/lexsub.t

index e285a84..ffabbd1 100644 (file)
@@ -231,9 +231,7 @@ is &$sub2, 49, 'state sub in closure (2)';
   my $x = 43;
   for $x (765) {
     state sub etetetet { $x }
-on;
-    is eval{etetetet}, $x, 'state sub ignores for() localisation';
-off;
+    is eval{etetetet}, 43, 'state sub ignores for() localisation';
   }
 }
 # And we also need to test that multiple state subs can close over each