mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
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.
22 lines
635 B
Nim
22 lines
635 B
Nim
# xxx consider merging this in tests/stdlib/tos.nim for increased coverage (with selecting disabling)
|
|
|
|
static: doAssert defined(nodejs)
|
|
|
|
import os
|
|
|
|
block:
|
|
doAssert "./foo//./bar/".normalizedPath == "foo/bar"
|
|
doAssert relativePath(".//foo/bar", "foo") == "bar"
|
|
doAssert "/".isAbsolute
|
|
doAssert not "".isAbsolute
|
|
doAssert not ".".isAbsolute
|
|
doAssert not "foo".isAbsolute
|
|
doAssert relativePath("", "bar") == ""
|
|
doAssert normalizedPath(".///foo//./") == "foo"
|
|
|
|
when nimvm: discard
|
|
else:
|
|
let cwd = getCurrentDir()
|
|
doAssert cwd.isAbsolute
|
|
doAssert relativePath(getCurrentDir() / "foo", "bar") == ".." / "foo"
|