[commit: packages/process] master: Use isInfixOf (for Windows) (1ffe7da)

git at git.haskell.org git at git.haskell.org
Wed Jul 19 21:17:15 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/1ffe7da7eed4aac042eb68fe06fdcfb8464668f5/process

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

commit 1ffe7da7eed4aac042eb68fe06fdcfb8464668f5
Author: Michael Snoyman <michael at snoyman.com>
Date:   Sun Nov 13 11:55:47 2016 +0200

    Use isInfixOf (for Windows)


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

1ffe7da7eed4aac042eb68fe06fdcfb8464668f5
 test/main.hs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/main.hs b/test/main.hs
index be941f9..f768b81 100644
--- a/test/main.hs
+++ b/test/main.hs
@@ -4,6 +4,7 @@ import System.Exit
 import System.IO.Error
 import System.Directory (getCurrentDirectory, setCurrentDirectory)
 import System.Process
+import Data.List (isInfixOf)
 
 main :: IO ()
 main = do
@@ -33,11 +34,11 @@ main = do
 
     withCurrentDirectory "exes" $ do
       res1 <- readCreateProcess (proc "./echo.bat" []) ""
-      unless (res1 == "parent\n") $ error $
+      unless ("parent" `isInfixOf` res1) $ error $
         "echo.bat with cwd failed: " ++ show res1
 
       res2 <- readCreateProcess (proc "./echo.bat" []) { cwd = Just "subdir" } ""
-      unless (res2 == "child\n") $ error $
+      unless ("child" `isInfixOf` res2) $ error $
         "echo.bat with cwd failed: " ++ show res2
 
     putStrLn "Tests passed successfully"



More information about the ghc-commits mailing list