tspecialpaths.nim 772 B

12345678910
  1. import stdtest/specialpaths
  2. import std/os
  3. block: # splitTestFile
  4. doAssert splitTestFile("tests/fakedir/tfakename.nim") == ("fakedir", "tests/fakedir/tfakename.nim".unixToNativePath)
  5. doAssert splitTestFile("/pathto/tests/fakedir/tfakename.nim") == ("fakedir", "/pathto/tests/fakedir/tfakename.nim".unixToNativePath)
  6. doAssert splitTestFile(getCurrentDir() / "tests/fakedir/tfakename.nim") == ("fakedir", "tests/fakedir/tfakename.nim".unixToNativePath)
  7. doAssert splitTestFile(getCurrentDir() / "sub/tests/fakedir/tfakename.nim") == ("fakedir", "sub/tests/fakedir/tfakename.nim".unixToNativePath)
  8. doAssertRaises(AssertionDefect): discard splitTestFile("testsbad/fakedir/tfakename.nim")
  9. doAssertRaises(AssertionDefect): discard splitTestFile("tests/tfakename.nim")