Skip to content

Commit

Permalink
Test IO::Path.lines can do sink-all
Browse files Browse the repository at this point in the history
Cover the issue exposed with
rakudo/rakudo@0c6281518e
that needed a `try` added.
  • Loading branch information
zoffixznet committed Mar 20, 2017
1 parent 465795c commit add852b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions S16-io/lines.t
Expand Up @@ -14,7 +14,7 @@ my @endings =
## adjusted plan to allow fine grained fudging for rakudo.jvm
#plan @endings * (1 + 3 * ( (3 * 5) + 6));
my $extra_tests_jvm_fudging = 2 * 3 * ( 3 * ( 6 + 2 ) );
plan 5 + @endings * (1 + 3 * ( 5 + 6)) + $extra_tests_jvm_fudging;
plan 6 + @endings * (1 + 3 * ( 5 + 6)) + $extra_tests_jvm_fudging;

my $filename = 't/spec/S16-io/lines.testing';
my @text = <zero one two three four>;
Expand Down Expand Up @@ -276,8 +276,12 @@ lives-ok {
.lines.rotor(:partial, 1 + .lines.elems).eager with $*PROGRAM.IO
}, '.lines does not crash with partial .rotor';

{ # https://github.com/rakudo/rakudo/commit/0c6281518e
is-deeply run(:out, $*EXECUTABLE, '-e', .say for ^3).out.lines(*).List,
("0", "1", "2"), 'can use Whatever as limit to IO::Pipe.lines';

is-deeply run(:out, $*EXECUTABLE, '-e', .say for ^3).out.lines(*).List,
("0", "1", "2"), 'can use Whatever as limit to IO::Pipe.lines';
lives-ok { run(:out, $*EXECUTABLE, "-e", "1.say").out.lines.sink },
'can sink-all IO::Pipe.lines';
}

# vim: ft=perl6

1 comment on commit add852b

@zoffixznet
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit title is wrong; the test is for IO::Pipe, not IO::Path

Please sign in to comment.