relativePath("foo", "foo") is now ".", not "" (#13452)
This commit is contained in:
parent
1276e386fe
commit
a43583f9c8
6 changed files with 37 additions and 8 deletions
|
|
@ -329,15 +329,19 @@ block ospaths:
|
|||
doAssert relativePath("/Users/me/bar/z.nim", "/Users/me", '/') == "bar/z.nim"
|
||||
doAssert relativePath("", "/users/moo", '/') == ""
|
||||
doAssert relativePath("foo", "", '/') == "foo"
|
||||
doAssert relativePath("/foo", "/Foo", '/') == (when FileSystemCaseSensitive: "../foo" else: "")
|
||||
doAssert relativePath("/Foo", "/foo", '/') == (when FileSystemCaseSensitive: "../Foo" else: "")
|
||||
doAssert relativePath("/foo", "/fOO", '/') == (when FileSystemCaseSensitive: "../foo" else: "")
|
||||
doAssert relativePath("/foO", "/foo", '/') == (when FileSystemCaseSensitive: "../foO" else: "")
|
||||
doAssert relativePath("/foo", "/Foo", '/') == (when FileSystemCaseSensitive: "../foo" else: ".")
|
||||
doAssert relativePath("/Foo", "/foo", '/') == (when FileSystemCaseSensitive: "../Foo" else: ".")
|
||||
doAssert relativePath("/foo", "/fOO", '/') == (when FileSystemCaseSensitive: "../foo" else: ".")
|
||||
doAssert relativePath("/foO", "/foo", '/') == (when FileSystemCaseSensitive: "../foO" else: ".")
|
||||
|
||||
doAssert relativePath("foo", ".", '/') == "foo"
|
||||
doAssert relativePath(".", ".", '/') == "."
|
||||
doAssert relativePath("..", ".", '/') == ".."
|
||||
|
||||
doAssert relativePath("foo", "foo") == "."
|
||||
doAssert relativePath("", "foo") == ""
|
||||
doAssert relativePath("././/foo", "foo//./") == "."
|
||||
|
||||
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue