summary refs log tree commit diff stats
path: root/tests/stdlib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-10-24 20:30:52 +0200
committerGitHub <noreply@github.com>2016-10-24 20:30:52 +0200
commit2f725e923e6c2288a4d8121ae667ed7425645d1a (patch)
tree0bc93e624be7b29a1b35b45112489d81db36e76a /tests/stdlib
parent8a0b9451705788fe7e4f09ad84450ac435e0cba0 (diff)
parent1cd4799b0137926dbeef9b3eb8076aa7df7a7fc5 (diff)
downloadNim-2f725e923e6c2288a4d8121ae667ed7425645d1a.tar.gz
Merge pull request #4924 from nigredo-tori/fix-4917
Make createDir return discardable bool
Diffstat (limited to 'tests/stdlib')
-rw-r--r--tests/stdlib/tos.nim22
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)