summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/IO/openFile003.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/lib/IO/openFile003.hs')
-rw-r--r--testsuite/tests/lib/IO/openFile003.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/lib/IO/openFile003.hs b/testsuite/tests/lib/IO/openFile003.hs
new file mode 100644
index 0000000000..81b69c40ec
--- /dev/null
+++ b/testsuite/tests/lib/IO/openFile003.hs
@@ -0,0 +1,14 @@
+import System.IO
+import System.IO.Error
+
+-- !!! Open a directory (should fail)
+
+main = do
+ r <- tryIOError (openFile "." ReadMode)
+ print r
+ r <- tryIOError (openFile "." WriteMode)
+ print r
+ r <- tryIOError (openFile "." AppendMode)
+ print r
+ r <- tryIOError (openFile "." ReadWriteMode)
+ print r