summary refs log tree commit diff stats
path: root/compiler/pathutils.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-09-07 13:13:35 +0200
committerAraq <rumpf_a@web.de>2018-09-07 19:21:16 +0200
commitb017138c32df2df2799ebb480bf1b8f5a461d300 (patch)
treea3efd8d5c91df333fc45f2d8e9f07ae2c6551fa2 /compiler/pathutils.nim
parent86556ebfdbbd4b8e9edc9d3085ea21d6c0bae2e2 (diff)
downloadNim-b017138c32df2df2799ebb480bf1b8f5a461d300.tar.gz
added a test for 'nim doc'
Diffstat (limited to 'compiler/pathutils.nim')
-rw-r--r--compiler/pathutils.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/pathutils.nim b/compiler/pathutils.nim
index f84d964bb..b27981159 100644
--- a/compiler/pathutils.nim
+++ b/compiler/pathutils.nim
@@ -180,7 +180,7 @@ proc relativeTo(full, base: string; sep = DirSep): string =
 when true:
   proc eqImpl(x, y: string): bool =
     when FileSystemCaseSensitive:
-      result = toLowerAscii(canon x) == toLowerAscii(canon y)
+      result = cmpIgnoreCase(canon x, canon y) == 0
     else:
       result = canon(x) == canon(y)
 
@@ -251,4 +251,5 @@ when isMainModule and defined(posix):
   doAssert relativeTo("", "/users/moo") == ""
   doAssert relativeTo("foo", "") == "foo"
 
-  echo string(AbsoluteDir"/Users/me///" / RelativeFile"z.nim")
+  doAssert AbsoluteDir"/Users/me///" / RelativeFile"z.nim" == AbsoluteFile"/Users/me/z.nim"
+  doAssert relativeTo("/foo/bar.nim", "/foo/") == "bar.nim"