Skip to content

Commit f2afb87

Browse files
committed
We shouldn't test for IO::Handle.lines(:close)
1 parent 073a95f commit f2afb87

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
@@ -14,7 +14,7 @@ my @endings =
1414
## adjusted plan to allow fine grained fudging for rakudo.jvm
1515
#plan @endings * (1 + 3 * ( (3 * 5) + 6));
1616
my $extra_tests_jvm_fudging = 2 * 3 * ( 3 * ( 6 + 2 ) );
17-
plan 4 + @endings * (1 + 3 * ( (3 * 5) + 6)) + $extra_tests_jvm_fudging;
17+
plan 4 + @endings * (1 + 3 * ( 5 + 6)) + $extra_tests_jvm_fudging;
1818

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

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

45-
my @lines = $first, |$handle.lines(|$closing);
34+
my $first;
35+
for $handle.lines -> $line {
4636
#?rakudo.jvm skip 'test will be run below with fine grained fudging'
47-
is @lines.join, @text.join($end[0]), "rest of file: $status";
48-
49-
is $handle.opened, $open, "handle still open: $status";
50-
ok $handle.close, "closed handle: $status";
37+
is $line,"@text[0]$end[0]", "read first line: $status";
38+
$first = $line;
39+
last;
5140
}
5241

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

0 commit comments

Comments
 (0)