From: Simon Marlow Date: Thu, 18 Jun 2009 10:29:00 +0000 (+0000) Subject: add a test for getDirectoryContents on a non-existent directory X-Git-Tag: 2009-06-25~2 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=1a0d5188a95335014a69ad0115c32466799dde8e;p=haskell-directory.git add a test for getDirectoryContents on a non-existent directory --- diff --git a/tests/all.T b/tests/all.T index 9455ef8..2677813 100644 --- a/tests/all.T +++ b/tests/all.T @@ -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 index 0000000..1b45a3a --- /dev/null +++ b/tests/getDirContents002.hs @@ -0,0 +1,3 @@ +import System.Directory + +main = getDirectoryContents "nonexistent" diff --git a/tests/getDirContents002.stderr b/tests/getDirContents002.stderr new file mode 100644 index 0000000..c90d9bc --- /dev/null +++ b/tests/getDirContents002.stderr @@ -0,0 +1 @@ +getDirContents002.exe: nonexistent: getDirectoryContents: does not exist (The system cannot find the path specified.)