Skip to content

Commit 6324959

Browse files
committed
We shouldn't test for IO::Handle.lines(:close)
1 parent 2c76bfa commit 6324959

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

S16-io/lines.t

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ my @endings =
1212
## adjusted plan to allow fine grained fudging for rakudo.jvm
1313
#plan @endings * (1 + 3 * ( (3 * 5) + 6));
1414
my $extra_tests_jvm_fudging = 2 * 3 * ( 3 * ( 6 + 2 ) );
15-
plan @endings * (1 + 3 * ( (3 * 5) + 6)) + $extra_tests_jvm_fudging;
15+
plan @endings * (1 + 3 * ( 5 + 6)) + $extra_tests_jvm_fudging;
1616

1717
my $filename = 't/spec/S16-io/lines.testing';
1818
my @text = <zero one two three four>;
@@ -26,28 +26,24 @@ for @endings -> (:key($eol), :value($EOL)) {
2626
for (), '', :chomp, '', :!chomp, $eol -> $chomp, $end {
2727
my $status = "{$chomp.gist} / $EOL";
2828

29-
for (), True, :close, False, :!close, True -> $closing, $open {
30-
my $handle = open($filename, :nl-in($eol), |$chomp);
31-
isa-ok $handle, IO::Handle;
32-
33-
my $status = OUTER::<$status> ~ " / {$open ?? 'open' !! 'close'}";
34-
35-
my $first;
36-
for $handle.lines(|$closing) -> $line {
37-
#?rakudo.jvm skip 'test will be run below with fine grained fudging'
38-
is $line,"@text[0]$end[0]", "read first line: $status";
39-
$first = $line;
40-
last;
41-
}
29+
my $handle = open($filename, :nl-in($eol), |$chomp);
30+
isa-ok $handle, IO::Handle;
4231

43-
my @lines = $first, |$handle.lines(|$closing);
32+
my $first;
33+
for $handle.lines -> $line {
4434
#?rakudo.jvm skip 'test will be run below with fine grained fudging'
45-
is @lines.join, @text.join($end[0]), "rest of file: $status";
46-
47-
is $handle.opened, $open, "handle still open: $status";
48-
ok $handle.close, "closed handle: $status";
35+
is $line,"@text[0]$end[0]", "read first line: $status";
36+
$first = $line;
37+
last;
4938
}
5039

40+
my @lines = $first, |$handle.lines;
41+
#?rakudo.jvm skip 'test will be run below with fine grained fudging'
42+
is @lines.join, @text.join($end[0]), "rest of file: $status";
43+
44+
ok $handle.opened, "handle still open";
45+
ok $handle.close, "closed handle";
46+
5147
# slicing
5248
my $handle = open($filename, :nl-in($eol), |$chomp);
5349
isa-ok $handle, IO::Handle;

0 commit comments

Comments
 (0)