Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 27 lines (19 sloc) 0.542 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
use v6;

use Test;

plan 3;

# 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 $main_invoked = 0;
my $eval_worked = 0;
EVAL q[
my @*ARGS = <a b>;
sub MAIN($a, $b) { $main_invoked = 1 };
$eval_worked = 1;
];
ok ! $!, 'no exception thrown';
ok $eval_worked, 'EVAL code executed';
#?rakudo todo 'MAIN in EVAL'
is $main_invoked, 0, 'sub MAIN is not called in EVAL()';

done;

# vim: ft=perl6
Something went wrong with that request. Please try again.