summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/libposix/posix010.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/lib/libposix/posix010.hs')
-rw-r--r--testsuite/tests/lib/libposix/posix010.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/lib/libposix/posix010.hs b/testsuite/tests/lib/libposix/posix010.hs
new file mode 100644
index 0000000000..83d5f27ee0
--- /dev/null
+++ b/testsuite/tests/lib/libposix/posix010.hs
@@ -0,0 +1,24 @@
+import Posix
+
+main =
+ getUserEntryForName "sof" >>= \ sof ->
+ getUserEntryForName "partain" >>= \ partain ->
+ putStr (ue2String sof) >>
+ putChar '\n' >>
+ putStr (ue2String partain) >>
+ putChar '\n' >>
+ getUserEntryForID (userID sof) >>= \ muid ->
+ getUserEntryForID (userID partain) >>= \ puid ->
+ putStr (ue2String muid) >>
+ putChar '\n' >>
+ putStr (ue2String puid) >>
+ putChar '\n'
+
+ue2String ue =
+ name ++ (':' : (show uid) ++ (':' : (show gid) ++ (':' : home ++ (':' : shell))))
+ where
+ name = userName ue
+ uid = userID ue
+ gid = userGroupID ue
+ home = homeDirectory ue
+ shell = userShell ue