Skip to content

Commit

Permalink
[v6.d REVIEW] Fix up fh-close-on-exit tests
Browse files Browse the repository at this point in the history
The first write to a handle is unbuffered, so the original test
likely doesn't cover the bug.

Orig: 08ac054de
  • Loading branch information
zoffixznet committed Oct 13, 2018
1 parent 2b3f279 commit cf93c5a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions S32-io/io-handle.t
Expand Up @@ -215,10 +215,13 @@ given make-temp-file() {
subtest 'opened filehandles get closed on exit automatically' => {
plan 2;
my $path = make-temp-file;
is_run $path.perl ~ .open(:w, :5000out-buffer).print: 'pass'; print 'pass',
{:out<pass>, :err(''), :0status}, 'written into a file without closing';
is_run my $fh := ~ $path.perl ~ .open: :w, :5000out-buffer;
$fh.print: 'pass'; $fh.print: '-pass2';
print 'pass'
, {:out<pass>, :err(''), :0status}, 'written into a file without closing';

is-deeply $path.slurp, 'pass', 'file has all the content we wrote into it';
is-deeply $path.slurp, 'pass-pass2',
'file has all the content we wrote into it';
}

{ # RT #131858
Expand Down

0 comments on commit cf93c5a

Please sign in to comment.