<commit_before>use v6;

use Test;

plan 2;

# RT #76896: 
# perl6 - sub/hash syntax

sub to_check {
    my %fs = ();
    %fs{ lc( 'A' ) } = &fa;
    sub fa() { return 'fa called.'; }

    %fs{ lc( 'B' ) } = &fb;
    sub fb() { return 'fb called.'; }

    my $fn = lc( @_[ 0 ] || 'A' );
    return "%s\n", %fs{ $fn }();
}

is to_check, "\%s\n fa called.", 'fa called ok';
is to_check('B'), "\%s\n fb called.", 'fb called ok';

# vim: ft=perl6
<commit_msg>remove the %\n stuff from the test; it doesn't add anything<commit_after>use v6;

use Test;

plan 2;

# RT #76896: 
# perl6 - sub/hash syntax

sub to_check {
    my %fs = ();
    %fs{ lc( 'A' ) } = &fa;
    sub fa() { return 'fa called.'; }

    %fs{ lc( 'B' ) } = &fb;
    sub fb() { return 'fb called.'; }

    my $fn = lc( @_[ 0 ] || 'A' );
    return %fs{ $fn }();
}

is to_check, "fa called.", 'fa called ok';
is to_check('B'), "fb called.", 'fb called ok';

# vim: ft=perl6

{'fraction_non_alphanumeric': 0.22376873661670235, 'fraction_numerical': 0.021413276231263382, 'mean_word_length': 2.4888059701492535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6847528', 'n_tokens_mistral': 426, 'n_tokens_neox': 405, 'n_words': 127}