<commit_before>use v6;
use Test;
BEGIN { @*INC.push('t/spec/packages/') };
use Test::Util;

plan 10;

# L<S32::IO/IO::Writeable::Encoded/"it is a compiler error">

eval_dies_ok('say', 'bare say is a compiler error');
eval_dies_ok('print', 'bare print is a compiler error');
eval_dies_ok('say()', 'say requires an argument');

is_run( 'say ()',
        {
            status => 0,
            out    => "\n",
            err    => '',
        },
        'say ()' );

is_run( 'say("")',
        {
            status => 0,
            out    => "\n",
            err    => '',
        },
        'say("")' );

# RT #61494
{
    eval 'say for 1';
    ok $! ~~ Exception, '"say for 1" (one space) is an error';
    my $errmsg = "$!";

    eval 'say  for 1';
    ok $! ~~ Exception, '"say  for 1" (two spaces) is an error';
    # XXX The problem with this test is the error messages might differ
    #     for innocuous reasons (e.g., a line number)
    #?rakudo 2 todo 'RT #61494'
    is "$!", $errmsg, 'error for two spaces is the same as one space';
    ok "$!" ~~ /« say »/, 'error message is for "say"';
}

# RT #74822
is_run( 'my %h=<a b c> Z 1,2,3; for %h { .say }',
        {
            status => 0,
            out    => "a\t1\nb\t2\nc\t3\n",
            err    => '',
        },
        'for %h { .say } (RT 74822)' );

# vim: ft=perl6
<commit_msg>rakudo fudging<commit_after>use v6;
use Test;
BEGIN { @*INC.push('t/spec/packages/') };
use Test::Util;

plan 10;

# L<S32::IO/IO::Writeable::Encoded/"it is a compiler error">

#?rakudo 3 todo 'nom regression'
eval_dies_ok('say', 'bare say is a compiler error');
eval_dies_ok('print', 'bare print is a compiler error');
eval_dies_ok('say()', 'say requires an argument');

is_run( 'say ()',
        {
            status => 0,
            out    => "\n",
            err    => '',
        },
        'say ()' );

is_run( 'say("")',
        {
            status => 0,
            out    => "\n",
            err    => '',
        },
        'say("")' );

# RT #61494
{
    eval 'say for 1';
    #?rakudo todo 'nom regression'
    ok $! ~~ Exception, '"say for 1" (one space) is an error';
    my $errmsg = "$!";

    eval 'say  for 1';
    #?rakudo todo 'nom regression'
    ok $! ~~ Exception, '"say  for 1" (two spaces) is an error';
    # XXX The problem with this test is the error messages might differ
    #     for innocuous reasons (e.g., a line number)
    is "$!", $errmsg, 'error for two spaces is the same as one space';
    #?rakudo todo 'RT #61494'
    ok "$!" ~~ /« say »/, 'error message is for "say"';
}

# RT #74822
#?rakudo todo 'RT #61494'
is_run( 'my %h=<a b c> Z 1,2,3; for %h { .say }',
        {
            status => 0,
            out    => "a\t1\nb\t2\nc\t3\n",
            err    => '',
        },
        'for %h { .say } (RT 74822)' );

# vim: ft=perl6

{'fraction_non_alphanumeric': 0.1853813559322034, 'fraction_numerical': 0.03001412429378531, 'mean_word_length': 1.9327122153209109, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, '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': '5140839', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1020, 'n_words': 319}