blob: 40fb52bcf74b76d360254919f721cfc24733ffcd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# 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"
|