@@ -2033,8 +2033,8 @@ cradleTests = testGroup "cradle"
20332033
20342034loadCradleOnlyonce :: TestTree
20352035loadCradleOnlyonce = testGroup "load cradle only once"
2036− [ testSessionTF "implicit" implicit
2037− , testSessionTF "direct" direct
2036+ [ testSession' "implicit" implicit
2037+ , testSession' "direct" direct
20382038 ]
20392039 where
20402040 direct dir = do
@@ -2143,10 +2143,7 @@ testSession :: String -> Session () -> TestTree
21432143testSession name = testCase name . run
21442144
21452145testSession' :: String -> (FilePath -> Session ()) -> TestTree
2146−testSession' name = testCase name . run' NoTestFlag
2147−
2148−testSessionTF :: String -> (FilePath -> Session ()) -> TestTree
2149−testSessionTF name = testCase name . run' WithTestFlag
2146+testSession' name = testCase name . run'
21502147
21512148testSessionWait :: String -> Session () -> TestTree
21522149testSessionWait name = testSession name .
@@ -2177,16 +2174,13 @@ mkRange :: Int -> Int -> Int -> Int -> Range
21772174mkRange a b c d = Range (Position a b) (Position c d)
21782175
21792176run :: Session a -> IO a
2180−run s = withTempDir $ \dir -> runInDir NoTestFlag dir s
2181−
2182−run' :: WithTestFlag -> (FilePath -> Session a) -> IO a
2183−run' tf s = withTempDir $ \dir -> runInDir tf dir (s dir)
2177+run s = withTempDir $ \dir -> runInDir dir s
21842178
2185−-- Do we run the LSP executable with --test or not
2186−data WithTestFlag = WithTestFlag | NoTestFlag deriving (Show, Eq)
2179+run' :: (FilePath -> Session a) -> IO a
2180+run' s = withTempDir $ \dir -> runInDir dir (s dir)
21872181
2188−runInDir :: WithTestFlag -> FilePath -> Session a -> IO a
2189−runInDir withTestFlag dir s = do
2182+runInDir :: FilePath -> Session a -> IO a
2183+runInDir dir s = do
21902184 ghcideExe <- locateGhcideExecutable
21912185
21922186 -- Temporarily hack around https://github.com/mpickering/hie-bios/pull/56
@@ -2199,8 +2193,7 @@ runInDir withTestFlag dir s = do
21992193 createDirectoryIfMissing True $ dir </> takeDirectory f
22002194 copyFile ("test/data" </> f) (dir </> f)
22012195
2202− let cmd = unwords ([ghcideExe, "--lsp", "--cwd", dir]
2203− ++ [ "--test" | WithTestFlag == withTestFlag ])
2196+ let cmd = unwords [ghcideExe, "--lsp", "--test", "--cwd", dir]
22042197 -- HIE calls getXgdDirectory which assumes that HOME is set.
22052198 -- Only sets HOME if it wasn't already set.
22062199 setEnv "HOME" "/homeless-shelter" False