summaryrefslogtreecommitdiff
path: root/t/test_pl/tempfile.t
diff options
context:
space:
mode:
Diffstat (limited to 't/test_pl/tempfile.t')
-rw-r--r--t/test_pl/tempfile.t15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/test_pl/tempfile.t b/t/test_pl/tempfile.t
index 881ecbf566..d507d60642 100644
--- a/t/test_pl/tempfile.t
+++ b/t/test_pl/tempfile.t
@@ -75,4 +75,19 @@ ok( !eval{tempfile()}, 'Should bail after Last available filename' );
my $err = "$@";
like( $err, qr{^Can't find temporary file name starting}, 'check error string' );
+{
+ my $returned = runperl( progs => [
+ 'require q[./test.pl];',
+ 'my $t = tempfile();',
+ 'print qq[$t|];',
+ 'print open(FH,q[>],$t) ? qq[ok|] : qq[not ok|] ;',
+ 'print -e $t ? qq[ok|] : qq[not ok|];',
+ ] );
+ my($filename,$opened,$existed) = split /\|/, $returned;
+
+ is( $opened, 'ok', "$filename created" );
+ is( $existed, 'ok', "$filename did exist" );
+ ok( !-e $filename, "$filename doesn't exist now" );
+}
+
done_testing();