lexsub.t: Fix a test
authorFather Chrysostomos <sprout@cpan.org>
Mon, 2 Jul 2012 19:29:48 +0000 (12:29 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 16 Sep 2012 05:44:54 +0000 (22:44 -0700)
This is not testing what I meant it to test: that ‘sub d’ will respect
a preceding ‘our sub d;’.  If ‘sub d’ is in the same package, it makes
no difference, so the test tests nothing.

It turns out this does not work yet.

t/cmd/lexsub.t

index 0b35964..0732678 100644 (file)
@@ -5,7 +5,7 @@ BEGIN {
     require './test.pl';
     *bar::is = *is;
 }
-plan 14;
+plan 13;
 
 {
   our sub foo { 42 }
@@ -59,11 +59,10 @@ sub bar::c { 43 }
 }
 {
   our sub d;
-  sub d { 'd42' }
   sub bar::d { 'd43' }
   package bar;
+  sub d { 'd42' }
   { local $::TODO = ' ';
-    is d, 'd42', 'our sub foo; applies to subsequent sub foo {}';
+    is eval { ::d },'d42', 'our sub foo; applies to subsequent sub foo {}';
   }
-  is &d, 'd42', 'our sub foo; applies to subsequent sub foo {} (amper)';
 }