Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[t/spec] more paranoia in main-eval.t

git-svn-id: http://svn.pugscode.org/pugs@29180 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit f8f11f4f06a4d7c0e14d9b05534284fc85e6061e 1 parent c2182e6
kyle authored
Showing with 11 additions and 4 deletions.
  1. +11 −4 S06-other/main-eval.t
View
15 S06-other/main-eval.t
@@ -2,15 +2,22 @@ use v6;
use Test;
-plan 1;
+plan *;
# 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()';
+my $main_invoked = 0;
+my $eval_worked = 0;
+eval q[
+ temp @*ARGS = <a b>;
+ sub MAIN($a, $b) { $main_invoked = 1 };
+ $eval_worked = 1;
+];
+ok ! $!, 'no exception thrown';
+ok $eval_worked, 'eval code executed';
+is $main_invoked, 0, 'sub MAIN is not called in eval()';
# vim: ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.