diff options
Diffstat (limited to 'testsuite/tests/lib/libposix/posix011.hs')
-rw-r--r-- | testsuite/tests/lib/libposix/posix011.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/tests/lib/libposix/posix011.hs b/testsuite/tests/lib/libposix/posix011.hs new file mode 100644 index 0000000000..f8baf1cbc2 --- /dev/null +++ b/testsuite/tests/lib/libposix/posix011.hs @@ -0,0 +1,22 @@ +import Posix + +main = + getGroupEntryForName "grasp" >>= \ grasp -> + getGroupEntryForName "staff" >>= \ staff -> + putStr (ge2String grasp) >> + putChar '\n' >> + putStr (ge2String staff) >> + putChar '\n' >> + getGroupEntryForID (groupID grasp) >>= \ guid -> + getGroupEntryForID (groupID staff) >>= \ suid -> + putStr (ge2String guid) >> + putChar '\n' >> + putStr (ge2String suid) >> + putChar '\n' + +ge2String ge = + name ++ (':' : (show gid) ++ (':' : members)) + where + name = groupName ge + gid = groupID ge + members = foldr (\x y -> x ++ (',' : y)) "" (groupMembers ge) |