tglobs.nim 789 B

1234567891011121314151617181920212223242526
  1. discard """
  2. matrix: "--mm:refc; --mm:orc"
  3. """
  4. import std/private/globs
  5. import std/assertions
  6. template main =
  7. when defined(windows):
  8. doAssert nativeToUnixPath("C:") == "/C"
  9. doAssert nativeToUnixPath(r"D:\") == "/D/"
  10. doAssert nativeToUnixPath(r"E:\a") == "/E/a"
  11. doAssert nativeToUnixPath(r"E:\a1\") == "/E/a1/"
  12. doAssert nativeToUnixPath(r"E:\a1\bc") == "/E/a1/bc"
  13. doAssert nativeToUnixPath(r"\a1\bc") == "/a1/bc"
  14. doAssert nativeToUnixPath(r"a1\bc") == "a1/bc"
  15. doAssert nativeToUnixPath("a1") == "a1"
  16. doAssert nativeToUnixPath("") == ""
  17. doAssert nativeToUnixPath(".") == "."
  18. doAssert nativeToUnixPath("..") == ".."
  19. doAssert nativeToUnixPath(r"..\") == "../"
  20. doAssert nativeToUnixPath(r"..\..\.\") == "../.././"
  21. static: main()
  22. main()