[commit: packages/unix] bgamari-patch-1, master: testsuite: Ensure that posix005 output is normalized (a3f6bc7)

git at git.haskell.org git at git.haskell.org
Wed Jul 19 22:04:34 UTC 2017


Repository : ssh://git@git.haskell.org/unix

On branches: bgamari-patch-1,master
Link       : http://ghc.haskell.org/trac/ghc/changeset/a3f6bc7b7a18fb841c04efe0ea137096cc036764/unix

>---------------------------------------------------------------

commit a3f6bc7b7a18fb841c04efe0ea137096cc036764
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Thu Nov 17 16:37:41 2016 -0500

    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.


>---------------------------------------------------------------

a3f6bc7b7a18fb841c04efe0ea137096cc036764
 tests/libposix/posix005.hs | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/tests/libposix/posix005.hs b/tests/libposix/posix005.hs
index 4365eb5..2988f4c 100644
--- a/tests/libposix/posix005.hs
+++ b/tests/libposix/posix005.hs
@@ -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
 



More information about the ghc-commits mailing list