diff options
author | Bram <p5p@perl.wizbit.be> | 2009-02-16 16:07:19 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-02-16 16:07:19 +0100 |
commit | 1ab9acc5e047d5b80c252fe3d5e4d905e6367701 (patch) | |
tree | 6633cf7d936a065f2e3c0a3b5512a65defe483aa /t/op/filetest.t | |
parent | 95bb830374a8a89f7b1a7056c1e3e3c778bfa350 (diff) | |
download | perl-1ab9acc5e047d5b80c252fe3d5e4d905e6367701.tar.gz |
Use tempfile() in tests
Diffstat (limited to 't/op/filetest.t')
-rwxr-xr-x | t/op/filetest.t | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/t/op/filetest.t b/t/op/filetest.t index 97ce3f9bf6..c73d747ba7 100755 --- a/t/op/filetest.t +++ b/t/op/filetest.t @@ -80,13 +80,14 @@ ok( (-s -f 'TEST' > 1), "-s returns real size" ); ok( -f -s 'TEST' == 1 ); # now with an empty file -open my $fh, ">", "foo"; +my $tempfile = tempfile(); +open my $fh, ">", $tempfile; close $fh; -ok( -f "foo" ); -is( -s "foo", 0 ); -is( -f -s "foo", 0 ); -is( -s -f "foo", 0 ); -unlink "foo"; +ok( -f $tempfile ); +is( -s $tempfile, 0 ); +is( -f -s $tempfile, 0 ); +is( -s -f $tempfile, 0 ); +unlink $tempfile; # test that _ is a bareword after filetest operators |