Commit a3f6bc7b authored by Ben Gamari's avatar Ben Gamari 🐢
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
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment