add a test for getDirectoryContents on a non-existent directory
authorSimon Marlow <marlowsd@gmail.com>
Thu, 18 Jun 2009 10:29:00 +0000 (10:29 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 18 Jun 2009 10:29:00 +0000 (10:29 +0000)
tests/all.T
tests/getDirContents002.hs [new file with mode: 0644]
tests/getDirContents002.stderr [new file with mode: 0644]

index 9455ef8..2677813 100644 (file)
@@ -5,6 +5,8 @@ test('doesDirectoryExist001',   normal, compile_and_run, [''])
 # This test is a bit bogus.  Disable for GHCi.
 test('getDirContents001', omit_ways(['ghci']), compile_and_run, ['-fno-gen-manifest'])
 
+test('getDirContents002', exit_code(1), compile_and_run, [''])
+
 # Depends on binary from previous run, which gets removed by the driver way=ghci
 test('getPermissions001', omit_ways(['ghci']), compile_and_run, ['-cpp'])
 
diff --git a/tests/getDirContents002.hs b/tests/getDirContents002.hs
new file mode 100644 (file)
index 0000000..1b45a3a
--- /dev/null
@@ -0,0 +1,3 @@
+import System.Directory\r
+\r
+main = getDirectoryContents "nonexistent"\r
diff --git a/tests/getDirContents002.stderr b/tests/getDirContents002.stderr
new file mode 100644 (file)
index 0000000..c90d9bc
--- /dev/null
@@ -0,0 +1 @@
+getDirContents002.exe: nonexistent: getDirectoryContents: does not exist (The system cannot find the path specified.)\r