Skip to content

Commit

Permalink
Update tests/js/tos.nim, make isAbsolute tested on nodejs under Windo…
Browse files Browse the repository at this point in the history
…ws. (nim-lang#23377)

Windows's nodejs `isAbsolute` issue has been resolved by [this
PR](nim-lang#23365).

So we can improve the coverage for Windows.
  • Loading branch information
lit authored and heterodoxic committed Mar 11, 2024
1 parent f3d40a8 commit 68cd81e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/js/tos.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ block:
doAssert not "foo".isAbsolute
doAssert relativePath("", "bar") == ""
doAssert normalizedPath(".///foo//./") == "foo"
let cwd = getCurrentDir()

let isWindows = '\\' in cwd
# defined(windows) doesn't work with -d:nodejs but should
# these actually break because of that (see https://github.com/nim-lang/Nim/issues/13469)
if not isWindows:
when nimvm: discard
else:
let cwd = getCurrentDir()
doAssert cwd.isAbsolute
doAssert relativePath(getCurrentDir() / "foo", "bar") == "../foo"
doAssert relativePath(getCurrentDir() / "foo", "bar") == ".." / "foo"

0 comments on commit 68cd81e

Please sign in to comment.