aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Ian Lynagh <igloo@earth.li>2007-11-10 23:58:05 +0000
committerGravatar Ian Lynagh <igloo@earth.li>2007-11-10 23:58:05 +0000
commit23d62156b0f9b87b4541688a535ca5aa378969a8 (patch)
treea75055939deaa7c548750b137ab2dc4db31af64a /tests
parent4dbad9911c72b9ecbf01afb19e57460dc016d912 (diff)
Throw a proper exception if getGroupEntryForName fails to find an entry
We used to get *** Exception: getGroupEntryForName: failed (Success) Fixes trac #1655
Diffstat (limited to 'tests')
-rw-r--r--tests/all.T2
-rw-r--r--tests/getGroupEntryForName.hs5
-rw-r--r--tests/getGroupEntryForName.stderr2
3 files changed, 9 insertions, 0 deletions
diff --git a/tests/all.T b/tests/all.T
index 2ae037f..6df75fe 100644
--- a/tests/all.T
+++ b/tests/all.T
@@ -18,4 +18,6 @@ if config.platform == 'i386-unknown-freebsd':
test('queryfdoption01', compose(omit_ways(['ghci']), compose(only_compiler_types(['ghc']), conf)),
compile_and_run, ['-package unix'])
test('getEnvironment01', conf, compile_and_run, ['-package unix'])
+test('getGroupEntryForName', compose(conf, expect_fail), compile_and_run,
+ ['-package unix'])
diff --git a/tests/getGroupEntryForName.hs b/tests/getGroupEntryForName.hs
new file mode 100644
index 0000000..bdb4272
--- /dev/null
+++ b/tests/getGroupEntryForName.hs
@@ -0,0 +1,5 @@
+
+import System.Posix.User
+
+main :: IO ()
+main = getGroupEntryForName "thisIsNotMeantToExist" >> return ()
diff --git a/tests/getGroupEntryForName.stderr b/tests/getGroupEntryForName.stderr
new file mode 100644
index 0000000..baf3997
--- /dev/null
+++ b/tests/getGroupEntryForName.stderr
@@ -0,0 +1,2 @@
+getGroupEntryForName: thisIsNotMeantToExist: getGroupEntryForName: does not exist (no group name)
+