Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 84b3895ce1beab1e016a3853d960fa08eb7f1a66 1 parent fa50707
@moritz moritz authored
View
1  S16-filehandles/mkdir_rmdir.t
@@ -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";
View
1  S32-io/chdir.t
@@ -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"),
View
2  packages/Test/Util.pm
@@ -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'";
}
Please sign in to comment.
Something went wrong with that request. Please try again.