Skip to content
Snippets Groups Projects
Commit a3f6bc7b authored by Ben Gamari's avatar Ben Gamari :turtle:
Browse files

testsuite: Ensure that posix005 output is normalized

The order in which getEnvironment returns its result is platform dependent. Sort
the output to ensure consistent output across platforms.
parent 245b6b1c
No related branches found
No related tags found
No related merge requests found
......@@ -2,20 +2,23 @@
import System.IO
import System.Posix.Env
printEnv :: IO ()
printEnv = getEnvironment >>= print . sort
main = do
hSetBuffering stdout NoBuffering
term <- getEnv "TERM"
maybe (return ()) putStrLn term
setEnvironment [("one","1"),("two","2")]
getEnvironment >>= print
printEnv
setEnv "foo" "bar" True
getEnvironment >>= print
printEnv
setEnv "foo" "baz" True
getEnvironment >>= print
printEnv
setEnv "fu" "bar" True
getEnvironment >>= print
printEnv
unsetEnv "foo"
getEnvironment >>= print
printEnv
clearEnv
getEnvironment >>= print
printEnv
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment