fix #13211 relativePath("foo", ".") (#13213)

This commit is contained in:
Timothee Cour
2020-01-21 06:48:19 -08:00
committed by Andreas Rumpf
parent bf96d6d316
commit b355ef2a72
2 changed files with 6 additions and 0 deletions

View File

@@ -334,6 +334,10 @@ block ospaths:
doAssert relativePath("/foo", "/fOO", '/') == (when FileSystemCaseSensitive: "../foo" else: "")
doAssert relativePath("/foO", "/foo", '/') == (when FileSystemCaseSensitive: "../foO" else: "")
doAssert relativePath("foo", ".", '/') == "foo"
doAssert relativePath(".", ".", '/') == "."
doAssert relativePath("..", ".", '/') == ".."
when doslikeFileSystem:
doAssert relativePath(r"c:\foo.nim", r"C:\") == r"foo.nim"
doAssert relativePath(r"c:\foo\bar\baz.nim", r"c:\foo") == r"bar\baz.nim"