diff --git a/test/integration/lib/StackTest.hs b/test/integration/lib/StackTest.hs index d7af4f38e6..6a3710e444 100644 --- a/test/integration/lib/StackTest.hs +++ b/test/integration/lib/StackTest.hs @@ -206,7 +206,7 @@ runRepl cmd args actions = do catch (hGetChar rStderr >>= hPutChar logFileHandle) (\e -> unless (isEOFError e) $ throw e) - runReaderT (nextPrompt >> actions) (ReplConnection rStdin rStdout) + runReaderT actions (ReplConnection rStdin rStdout) waitForProcess ph repl :: HasCallStack => [String] -> Repl () -> IO () diff --git a/test/integration/tests/3926-ghci-with-sublibraries/Main.hs b/test/integration/tests/3926-ghci-with-sublibraries/Main.hs index 8261f2bd71..df43dd9891 100644 --- a/test/integration/tests/3926-ghci-with-sublibraries/Main.hs +++ b/test/integration/tests/3926-ghci-with-sublibraries/Main.hs @@ -5,17 +5,25 @@ import Data.List import StackTest main :: IO () -main = do - stack ["clean"] -- to make sure we can load the code even after a clean - copy "src/Lib.v1" "src/Lib.hs" - copy "src-internal/Internal.v1" "src-internal/Internal.hs" - stack ["build"] -- need a build before ghci at the moment, see #4148 - forkIO fileEditingThread - replThread +main + | isWindows = + putStrLn "This test was disabled on Windows on 25 June 2023 (see \ + \https://github.com/commercialhaskell/stack/issues/6170)." + | otherwise = do + stack ["clean"] -- to make sure we can load the code even after a clean + copy "src/Lib.v1" "src/Lib.hs" + copy "src-internal/Internal.v1" "src-internal/Internal.hs" + stack ["build"] -- need a build before ghci at the moment, see #4148 + forkIO fileEditingThread + replThread replThread :: IO () replThread = repl [] $ do + -- The command must be issued before searching the output for the next prompt, + -- otherwise, on Windows from msys2-20230526, `stack repl` encounters a EOF + -- and terminates gracefully. replCommand ":main" + nextPrompt line <- replGetLine let expected = "hello world" when (line /= expected) $ diff --git a/test/integration/tests/4270-files-order/Main.hs b/test/integration/tests/4270-files-order/Main.hs index 41aaaf7009..4219d3ae7c 100644 --- a/test/integration/tests/4270-files-order/Main.hs +++ b/test/integration/tests/4270-files-order/Main.hs @@ -3,13 +3,17 @@ import StackTest main :: IO () main = do - stack ["build"] - repl [] $ do - replCommand "putStrLn greeting" - line <- replGetLine - let expected = "Hello, world!" - when (line /= expected) $ - error $ - "Didn't load correctly.\n" - <> "Expected: " <> expected <> "\n" - <> "Actual : " <> line <> "\n" + stack ["build"] + repl [] $ do + -- The command must be issued before searching the output for the next + -- prompt, otherwise, on Windows from msys2-20230526, `stack repl` + -- encounters a EOF and terminates gracefully. + replCommand "putStrLn greeting" + nextPrompt + line <- replGetLine + let expected = "Hello, world!" + when (line /= expected) $ + error $ + "Didn't load correctly.\n" + <> "Expected: " <> expected <> "\n" + <> "Actual : " <> line <> "\n" diff --git a/test/integration/tests/module-added-multiple-times/Main.hs b/test/integration/tests/module-added-multiple-times/Main.hs index d58794babe..d2745cffa3 100644 --- a/test/integration/tests/module-added-multiple-times/Main.hs +++ b/test/integration/tests/module-added-multiple-times/Main.hs @@ -4,11 +4,15 @@ import StackTest main :: IO () main = repl [] $ do - replCommand ":main" - line <- replGetLine - let expected = "Hello World!" - when (line /= expected) $ - error $ - "Main module didn't load correctly.\n" - <> "Expected: " <> expected <> "\n" - <> "Actual : " <> line <> "\n" + -- The command must be issued before searching the output for the next prompt, + -- otherwise, on Windows from msys2-20230526, `stack repl` encounters a EOF + -- and terminates gracefully. + replCommand ":main" + nextPrompt + line <- replGetLine + let expected = "Hello World!" + when (line /= expected) $ + error $ + "Main module didn't load correctly.\n" + <> "Expected: " <> expected <> "\n" + <> "Actual : " <> line <> "\n"