tglobs.nim 740 B

12345678910111213141516171819202122
  1. import std/private/globs
  2. import std/assertions
  3. template main =
  4. when defined(windows):
  5. doAssert nativeToUnixPath("C:") == "/C"
  6. doAssert nativeToUnixPath(r"D:\") == "/D/"
  7. doAssert nativeToUnixPath(r"E:\a") == "/E/a"
  8. doAssert nativeToUnixPath(r"E:\a1\") == "/E/a1/"
  9. doAssert nativeToUnixPath(r"E:\a1\bc") == "/E/a1/bc"
  10. doAssert nativeToUnixPath(r"\a1\bc") == "/a1/bc"
  11. doAssert nativeToUnixPath(r"a1\bc") == "a1/bc"
  12. doAssert nativeToUnixPath("a1") == "a1"
  13. doAssert nativeToUnixPath("") == ""
  14. doAssert nativeToUnixPath(".") == "."
  15. doAssert nativeToUnixPath("..") == ".."
  16. doAssert nativeToUnixPath(r"..\") == "../"
  17. doAssert nativeToUnixPath(r"..\..\.\") == "../.././"
  18. static: main()
  19. main()