<commit_before>use v6;
use Test;

plan 2;

# RT #125515
my @got;
for ^100 {
    my $p = $*DISTRO.is-win
        ?? Proc::Async.new( | < cmd /c type README.md > )
        !! Proc::Async.new( | < /bin/cat README.md > );
    my $output = '';
    $p.stdout.tap: -> $s { $output ~= $s; };
    await $p.start;
    @got.push: $output;
}
is @got.unique.elems, 1, 'Proc::Async consistently reads data';

# RT #129291
{
    if $*DISTRO.is-win {
        skip 1, 'not sure how to test input redirection on Windows';
    } else {
        lives-ok
            { for ^10000 { my $p = run(:out, :bin, 'ls'); run(:in($p.out), 'true') } },
            "run()ning two procs and passing the :out of one to the :in of the other doesn't hang";
    }
}<commit_msg>Better test description for test added in 6cc1a85cf<commit_after>use v6;
use Test;

plan 2;

# RT #125515
my @got;
for ^100 {
    my $p = $*DISTRO.is-win
        ?? Proc::Async.new( | < cmd /c type README.md > )
        !! Proc::Async.new( | < /bin/cat README.md > );
    my $output = '';
    $p.stdout.tap: -> $s { $output ~= $s; };
    await $p.start;
    @got.push: $output;
}
is @got.unique.elems, 1, 'Proc::Async consistently reads data';

# RT #129291
{
    if $*DISTRO.is-win {
        skip 1, 'not sure how to test input redirection on Windows';
    } else {
        lives-ok
            { for ^10000 { my $p = run(:out, :bin, 'ls'); run(:in($p.out), 'true') } },
            "run()ning two procs and passing the :out of one to the :in of the other doesn't segfault";
    }
}
{'fraction_non_alphanumeric': 0.17716535433070865, 'fraction_numerical': 0.03412073490813648, 'mean_word_length': 2.3296943231441047, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7111871', 'n_tokens_mistral': 614, 'n_tokens_neox': 570, 'n_words': 173}