Implement and check the behavior to calculate parents from exclusively-relative paths (`.`, `..`)
Closed this issue · 1 comments
ForNeVeR commented
Currently, new LocalPath(".").Parent
(the same for paths like ..
or ../..
) is not defined: I'm not sure what it should be.
We need to see how other libraries define this path's parent (I lean towards null
) and implement the same logic.
ForNeVeR commented
After some work and discussion done in scope of #83, my current decision is that generally, (path1 / path2).Parent
should yield the same result (if any) as path1 / path2.Parent
.
Meaning new LocalPath(".").Parent
should be ..
, and e.g. new LocalPath("../..").Parent
should be ../../..
.
IIRC there's still a weird corner case in how we handle /..
absolute path (it could break the invariant); I am planning to handle that separately.