Skip to content

Commit

Permalink
Test opened filehandles get closed on exit automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Oct 15, 2017
1 parent 611988f commit 08ac054
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S32-io/io-handle.t
Expand Up @@ -3,7 +3,7 @@ use lib <t/spec/packages>;
use Test;
use Test::Util;

plan 27;
plan 28;

my $path = "io-handle-testfile";

Expand Down Expand Up @@ -270,3 +270,13 @@ subtest '.print-nl method' => {
lives-ok { for .lines { } }, 'No spurious malformed UTF-8 error';
}
}

# RT #132030
subtest 'opened filehandles get closed on exit automatically' => {
plan 2;
my $path = make-temp-file;
is_run $path.perl ~ .open(:w, :5000buffer).print: 'pass'; 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';
}

0 comments on commit 08ac054

Please sign in to comment.