From 94c599687796f4ee3872c8aa866827b9ed33f52b Mon Sep 17 00:00:00 2001 From: lit <2636353816@qq.com> Date: Sat, 9 Mar 2024 18:43:27 +0800 Subject: [PATCH] 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. --- tests/js/tos.nim | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/js/tos.nim b/tests/js/tos.nim index bfe3cd9b4f..40fb52bcf7 100644 --- a/tests/js/tos.nim +++ b/tests/js/tos.nim @@ -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"