diff options
Diffstat (limited to 'tests/stdlib')
-rw-r--r-- | tests/stdlib/tos.nim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/stdlib/tos.nim b/tests/stdlib/tos.nim index 1ddaacfcb..1ef02f97e 100644 --- a/tests/stdlib/tos.nim +++ b/tests/stdlib/tos.nim @@ -36,6 +36,9 @@ false false false false +true +true +Raises ''' """ # test os path creation, iteration, and deletion @@ -86,3 +89,22 @@ for file in files: removeDir(dname) echo dirExists(dname) + +# createDir should create recursive directories +createDir(dirs[0] / dirs[1]) +echo dirExists(dirs[0] / dirs[1]) # true +removeDir(dirs[0]) + +# createDir should properly handle trailing separator +createDir(dname / "") +echo dirExists(dname) # true +removeDir(dname) + +# createDir should raise IOError if the path exists +# and is not a directory +open(dname, fmWrite).close +try: + createDir(dname) +except IOError: + echo "Raises" +removeFile(dname) |