Browse files

[IO] handle dying unlink and mkdir

Rakudo now throws exceptions for failed &unlink and &mkdir calls.
This is a deliberate deviation from the existing tests (and maybe spec),
because we don't have sink context yet, which leads to failures silently
being ignored.

This commit fudges two tests for rakudo, and makes Test::Util happy again.
  • Loading branch information...
1 parent fa50707 commit 84b3895ce1beab1e016a3853d960fa08eb7f1a66 @moritz moritz committed Apr 17, 2012
Showing with 3 additions and 1 deletion.
  1. +1 −0 S16-filehandles/mkdir_rmdir.t
  2. +1 −0 S32-io/chdir.t
  3. +1 −1 packages/Test/
@@ -21,6 +21,7 @@ ok mkdir("$root/green"), "mkdir $root/green returns true";
ok "$root/green".IO ~~ :e, "$root/green now exists";
ok "$root/green".IO ~~ :d, "... and is a directory";
+#?rakudo skip 'deviation from spec because we do not have sink yet'
nok rmdir($root), "Get false when we try to rmdir a directory with something in it";
ok $root.IO ~~ :e, "$root still exists";
@@ -41,6 +41,7 @@ if $no_subdir.IO ~~ :d {
skip "subdir '$no_subdir' does exist, actually.", 2;
else {
+ #?rakudo 2 skip 'spec non-conformance due to missing sink context'
lives_ok { chdir("$no_subdir") },
'chdir to a non-existent does not by default throw an exception';
ok !chdir("$no_subdir"),
@@ -104,8 +104,8 @@ sub get_out( Str $code, Str $input?, :@args) is export {
# Try to delete all the temp files written. If any survive, die.
my @files = map { "$fnbase.$_" }, <code in out err>;
- unlink $_ for @files;
for @files -> $f {
+ try unlink $f;
if $f.IO ~~ :e {
die "Can't unlink '$f'";

0 comments on commit 84b3895

Please sign in to comment.