Permalink
Browse files

[t/spec] Break a test out into a separate file that in an eval clobbe…

…red the MAIN that was expected to be run as part of the test Also correct that test.

git-svn-id: http://svn.pugscode.org/pugs@25827 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent c57f16c commit d39311aecacbf7d5195d6883fd8a8f4218637a76 jnthn committed Mar 14, 2009
Showing with 15 additions and 12 deletions.
  1. +14 −0 S06-other/main-eval.t
  2. +1 −12 S06-other/main.t
View
@@ -0,0 +1,14 @@
+use v6;
+
+use Test;
+
+plan 1;
+
+# L<S06/Declaring a C<MAIN> subroutine/"the compilation unit was directly
+# invoked rather than by being required by another compilation unit">
+
+# a MAIN sub in eval() shouldn't be called
+
+my $invoked = 0;
+eval 'temp @*ARGS = <a b>; sub MAIN($a, $b) { $invoked = 1 };';
+is $invoked, 0, 'sub MAIN is not called in eval()';
View
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 6;
+plan 5;
## If this test file is fudged, then MAIN never executes because
## the fudge script introduces an C<exit(1)> into the mainline.
@@ -22,15 +22,4 @@ sub MAIN($a, $b, *@c) {
ok( @*ARGS == 5, '@*ARGS has correct elements');
-
-# L<S06/Declaring a C<MAIN> subroutine/"the compilation unit was directly
-# invoked rather than by being required by another compilation unit">
-
-# a MAIN sub in eval() shouldn't be called
-
-my $invoked = 0;
-eval 'temp @*ARGS = <a b>; sub MAIN($a, $b) { $invoked = 0 };';
-#?rakudo skip 'temp(), lexicals shared in eval() (noauto)'
-is $invoked, 0, 'sub MAIN is not called in eval()';
-
# vim: ft=perl6

0 comments on commit d39311a

Please sign in to comment.