Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[io grant] Amend rules for last part in IO::Path.resolve
Allow last part of path to not exist when using .resolve: :completely;
The resolution is still successful, and this lets us
.resolve(:completely) paths that we're about to create.
  • Loading branch information
zoffixznet committed Apr 16, 2017
1 parent 35402f6 commit a716962
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions S32-io/io-path.t
Expand Up @@ -131,7 +131,7 @@ subtest '.concat-with' => {
}

subtest '.resolve' => {
plan 4;
plan 5;

my $root = make-temp-dir;
sub p { $root.concat-with: $^path }
Expand All @@ -141,7 +141,7 @@ subtest '.resolve' => {
p('not-there').absolute,
".resolve() cleans up paths it can't resolve";

fails-like { p('level1a/../not-there').resolve(:completely) },
fails-like { p('level1a/../not-there/foo').resolve(:completely) },
X::IO::Resolve, '.resolve(:completely) fails with X::IO::Resolve';

is-deeply
Expand All @@ -155,6 +155,10 @@ subtest '.resolve' => {
~ '../level2b/level3a').resolve(:completely).absolute,
p('level1c/level2b/level3a').absolute,
".resolve(:completely) cleans up paths it can resolve";

is-deeply p('level1a/../not-there').resolve(:completely).absolute,
p('not-there').absolute,
'.resolve(:completely) succeeds even when last part does not exist';
}

subtest '.link' => {
Expand Down

0 comments on commit a716962

Please sign in to comment.