<commit_before>use v6;

use Test;

# L<S03/Assignment operators/A op= B>

plan 19;

#?rakudo skip '.= with spaces'
{
    my @a = (1, 2, 3);
    lives_ok({@a .= map: { $_ + 1 }}, '.= runs with adverbial block');
    is(@a[0], 2, 'inplace map [0]');
    is(@a[1], 3, 'inplace map [1]');
    is(@a[2], 4, 'inplace map [2]');
}

{
    my @b = <foo 123 bar 456 baz>;
    lives_ok { @b.=grep({/<[a..z]>/})},
             '.= works without surrounding whitespace';
    is @b[0], 'foo', 'inplace grep [0]';
    is @b[1], 'bar', 'inplace grep [1]';
    is @b[2], 'baz', 'inplace grep [2]';
}

#?rakudo skip '.='
{
    my $a=3.14;
    $a .= int;
    is($a, 3, "inplace int");

    my $b = "a_string"; $b .= WHAT;
    my $c =         42; $c .= WHAT;
    my $d =      42.23; $d .= WHAT;<commit_msg>[t/spec] corrected a test description<commit_after>use v6;

use Test;

# L<S03/Assignment operators/A op= B>

plan 19;

#?rakudo skip '.= with spaces'
{
    my @a = (1, 2, 3);
    lives_ok({@a .= map: { $_ + 1 }}, '.= runs with block');
    is(@a[0], 2, 'inplace map [0]');
    is(@a[1], 3, 'inplace map [1]');
    is(@a[2], 4, 'inplace map [2]');
}

{
    my @b = <foo 123 bar 456 baz>;
    lives_ok { @b.=grep({/<[a..z]>/})},
             '.= works without surrounding whitespace';
    is @b[0], 'foo', 'inplace grep [0]';
    is @b[1], 'bar', 'inplace grep [1]';
    is @b[2], 'baz', 'inplace grep [2]';
}

#?rakudo skip '.='
{
    my $a=3.14;
    $a .= int;
    is($a, 3, "inplace int");

    my $b = "a_string"; $b .= WHAT;
    my $c =         42; $c .= WHAT;
    my $d =      42.23; $d .= WHAT;
{'fraction_non_alphanumeric': 0.24653215636822196, 'fraction_numerical': 0.05044136191677175, 'mean_word_length': 2.3270440251572326, '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': '5158072', 'n_tokens_mistral': 752, 'n_tokens_neox': 693, 'n_words': 196}