Skip to content

Commit ca40375

Browse files
briandfoykhwilliamson
authored andcommitted
todo test for 16008 (truncate scalar fh)
kwilliamson gave a talk in 2025 asking people to contribute tests to this file to perhaps find old issues that are no longer a problem. I disclaim the bounty he offered. :) https://www.youtube.com/watch?v=CwX4Xsf5y5E
1 parent f3a5b2b commit ca40375

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

t/run/todo.t

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ my $switches = "";
3333
}
3434

3535
our $TODO;
36+
37+
TODO: {
38+
local $::TODO = "GH 16008";
39+
my $results = fresh_perl(<<~'EOF', {} );
40+
open my $h, ">", \my $x;
41+
print $h "hello earthlings\n";
42+
$h->truncate(6) or die $!;
43+
print $x;
44+
EOF
45+
is($?, 0, 'No assertion failure');
46+
47+
is $results, 'hello ', "truncate returned the expected output";
48+
unlike $results, qr/Bad file descriptor/, "truncate did not warn about bad file descriptors";
49+
}
50+
3651
TODO: {
3752
local $TODO = "GH 16250";
3853
fresh_perl_is(<<~'EOF',

0 commit comments

Comments
 (0)