<commit_before>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()';

# vim: ft=perl6
<commit_msg>[t/spec] more paranoia in main-eval.t<commit_after>use v6;

use Test;

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 $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

{'fraction_non_alphanumeric': 0.13626834381551362, 'fraction_numerical': 0.01781970649895178, 'mean_word_length': 4.079787234042553, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6919991', 'n_tokens_mistral': 368, 'n_tokens_neox': 347, 'n_words': 132}