-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support path resolution #228
Conversation
0430ebf
to
52b7387
Compare
} | ||
|
||
@Test | ||
fun resolve() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I need to add more tests: to check for an exception if the path does not exist, to check for an absolute path, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the test for absolute path, all other cases are already there.
It would be nice to test symlink resolution, but we don't have an API for links yet.
val root = createTempPath() | ||
SystemFileSystem.createDirectories(Path(root, "a", "b")) | ||
val tgt = Path(root, "c", "d") | ||
SystemFileSystem.createDirectories(tgt) | ||
|
||
val src = Path(root, "a", "..", "a", ".", "b", "..", "..", "c", ".", "d") | ||
try { | ||
// root/a/../a/./b/../../c/./d -> root/c/d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fixes #223