From 1a0d5188a95335014a69ad0115c32466799dde8e Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 18 Jun 2009 10:29:00 +0000 Subject: [PATCH] add a test for getDirectoryContents on a non-existent directory --- tests/all.T | 2 ++ tests/getDirContents002.hs | 3 +++ tests/getDirContents002.stderr | 1 + 3 files changed, 6 insertions(+) create mode 100644 tests/getDirContents002.hs create mode 100644 tests/getDirContents002.stderr 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.) -- 1.7.10.4