summary refs log tree commit diff stats
path: root/tests/stdlib/tos.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib/tos.nim')
-rw-r--r--tests/stdlib/tos.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/stdlib/tos.nim b/tests/stdlib/tos.nim
index a1ea60feb..1ef02f97e 100644
--- a/tests/stdlib/tos.nim
+++ b/tests/stdlib/tos.nim
@@ -38,6 +38,7 @@ false
 false
 true
 true
+Raises
 '''
 """
 # test os path creation, iteration, and deletion
@@ -98,3 +99,12 @@ removeDir(dirs[0])
 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)