Permalink
Browse files

be less paranoid about the actual return value of unlink, just evalua…

…te it in boolean context
  • Loading branch information...
1 parent 9100295 commit 76534ab35a9fafc81825ea4b0e671ccb918d455e @moritz moritz committed Feb 26, 2011
Showing with 5 additions and 5 deletions.
  1. +1 −1 S16-filehandles/io.t
  2. +1 −1 S16-filehandles/io_in_for_loops.t
  3. +1 −1 S16-filehandles/io_in_while_loops.t
  4. +2 −2 S16-filehandles/unlink.t
View
@@ -157,7 +157,7 @@ is(@lines10[2], "The End", 'lines($filename,3) worked in list context');
}
#now be sure to delete the file as well
-is(unlink($filename), 1, 'file has been removed');
+ok(unlink($filename), 'file has been removed');
# new file for testing other types of open() calls
@@ -99,6 +99,6 @@ my $filename = 'tempfile_io_in_for_loop';
# old: L<S16/"Filehandles, files, and directories"/"unlink">
# L<S29/IO/unlink>
-is(unlink($filename), 1, 'file has been removed');
+ok(unlink($filename), 'file has been removed');
# vim: ft=perl6
@@ -44,6 +44,6 @@ my $filename = 'tempfile_io_in_while_loop';
$fh.close();
}
-is(unlink($filename), 1, 'file has been removed');
+ok(unlink($filename), 'file has been removed');
# vim: ft=perl6
View
@@ -22,7 +22,7 @@ my $iswin32 = ?($*OS eq any <MSWin32 mingw msys cygwin>) ?? "Timely closing of f
close $fh;
ok $fn.IO ~~ :e, "open() created a tempfile";
- is(unlink($fn), 1, "unlink() returned true");
+ ok(unlink($fn), "unlink() returned true");
ok $fn.IO !~~ :e, "unlink() actually deleted the tempfile";
}
@@ -31,7 +31,7 @@ my $iswin32 = ?($*OS eq any <MSWin32 mingw msys cygwin>) ?? "Timely closing of f
{ my $fh = open($fn, :w) }
ok $fn.IO ~~ :e, "open() created a tempfile";
- is(unlink($fn), 1, "unlink() returned true");
+ ok(unlink($fn), "unlink() returned true");
#?rakudo skip 'implicit closure of file handle at scope exit not implemented (FAILS ON WINDOWS)'
ok $fn.IO !~~ :e, "unlink() actually deleted the tempfile";
}

0 comments on commit 76534ab

Please sign in to comment.