Skip to content

Commit 5b2927c

Browse files
committed
refactor: rename StackTest.Repl.{repl → stackRepl}
1 parent 38d03c2 commit 5b2927c

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

tests/integration/lib/StackTest/Repl.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ module StackTest.Repl
55
( Repl
66
, ReplConnection (..)
77
, nextPrompt
8-
, repl
98
, replCommand
109
, replGetLine
10+
, stackRepl
1111
) where
1212

1313
import Control.Exception (SomeException, catch, displayException, finally)
@@ -115,8 +115,9 @@ openTempStderrBufferFile = getTempDir >>= (`openTempFile` "err.log") where
115115
getTempDir | isWindows = fromMaybe "" <$> lookupEnv "TEMP"
116116
| otherwise = pure "/tmp"
117117

118-
repl :: HasCallStack => [String] -> Repl () -> IO ()
119-
repl args action = do
118+
-- | Testing helper to exercise `stack repl`.
119+
stackRepl :: HasCallStack => [String] -> Repl () -> IO ()
120+
stackRepl args action = do
120121
stackExe' <- stackExe
121122
ec <- runRepl stackExe' ("repl" : "--ghci-options=-ignore-dot-ghci" : args) action
122123
unless (ec == ExitSuccess) $ do
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import StackTest
1+
import StackTest.Repl
22

33
main :: IO ()
44
main = do
55
stack ["build", "--ghc-options=-ddump-simpl -ddump-asm -DBAR -DBAZ"]
6-
repl ["--ghc-options=-ddump-simpl -ddump-asm"] (pure ())
6+
stackRepl ["--ghc-options=-ddump-simpl -ddump-asm"] (pure ())

tests/integration/tests/3926-ghci-with-sublibraries/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ main = do
1010
copy "src/Lib.v1" "src/Lib.hs"
1111
copy "src-internal/Internal.v1" "src-internal/Internal.hs"
1212
stack ["build"] -- need a build before ghci at the moment, see #4148
13-
repl [] $ do
13+
stackRepl [] $ do
1414
-- The command must be issued before searching the output for the next prompt,
1515
-- otherwise, on Windows from msys2-20230526, `stack repl` encounters a EOF
1616
-- and terminates gracefully.

tests/integration/tests/4270-files-order/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import StackTest.Repl
55
main :: IO ()
66
main = do
77
stack ["build"]
8-
repl [] $ do
8+
stackRepl [] $ do
99
-- The command must be issued before searching the output for the next
1010
-- prompt, otherwise, on Windows from msys2-20230526, `stack repl`
1111
-- encounters a EOF and terminates gracefully.

tests/integration/tests/module-added-multiple-times/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Control.Monad
22
import StackTest.Repl
33

44
main :: IO ()
5-
main = repl [] $ do
5+
main = stackRepl [] $ do
66
-- The command must be issued before searching the output for the next prompt,
77
-- otherwise, on Windows from msys2-20230526, `stack repl` encounters a EOF
88
-- and terminates gracefully.

0 commit comments

Comments
 (0)