Update tests/js/tos.nim, make isAbsolute tested on nodejs under Windows. (#23377)

Windows's nodejs `isAbsolute` issue has been resolved by [this
PR](https://github.com/nim-lang/Nim/pull/23365).

So we can improve the coverage for Windows.
This commit is contained in:
lit
2024-03-09 18:43:27 +08:00
committed by GitHub
parent 1e20165a15
commit 94c5996877

View File

@@ -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"