tglobs.nim 718 B

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