Skip to content

Commit 52be8d2

Browse files
committed
clean up
1 parent e6bbcaf commit 52be8d2

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

ghcide/test/exe/Main.hs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ cancellationTemplate (edit, undoEdit) mbKey = testCase (maybe "-" fst mbKey) $ r
710710
expectNoMoreDiagnostics 0.5
711711
where
712712
-- similar to run except it disables kick
713-
runTestNoKick s = withTempDir $ \dir -> runInDir' argsNoKick dir "." "." s
713+
runTestNoKick s = withTempDir $ \dir -> runInDir' argsNoKick dir "." s
714714
argsNoKick = def { IDE.argsRules = mainRule }
715715

716716
typeCheck doc = do
@@ -4936,16 +4936,16 @@ benchmarkTests =
49364936

49374937
-- | checks if we use InitializeParams.rootUri for loading session
49384938
rootUriTests :: TestTree
4939-
rootUriTests = testCase "use rootUri" . runTest "dirA" "dirB" $ \dir -> do
4939+
rootUriTests = testCase "use rootUri" . runTest "dirB" $ \dir -> do
49404940
let bPath = dir </> "dirB/Foo.hs"
49414941
liftIO $ copyTestDataFiles dir "rootUri"
49424942
bSource <- liftIO $ readFileUtf8 bPath
49434943
_ <- createDoc "Foo.hs" "haskell" bSource
49444944
expectNoMoreDiagnostics 0.5
49454945
where
49464946
-- similar to run' except we can configure where to start ghcide and session
4947-
runTest :: FilePath -> FilePath -> (FilePath -> Session ()) -> IO ()
4948-
runTest dir1 dir2 s = withTempDir $ \dir -> runInDir' def dir dir1 dir2 (s dir)
4947+
runTest :: FilePath -> (FilePath -> Session ()) -> IO ()
4948+
runTest dir2 s = withTempDir $ \dir -> runInDir' def dir dir2 (s dir)
49494949

49504950
-- | Test if ghcide asynchronously handles Commands and user Requests
49514951
asyncTests :: TestTree
@@ -5229,27 +5229,22 @@ run' :: (FilePath -> Session a) -> IO a
52295229
run' s = withTempDir $ \dir -> runInDir dir (s dir)
52305230

52315231
runInDir :: FilePath -> Session a -> IO a
5232-
runInDir dir = runInDir' def dir "." "."
5232+
runInDir dir = runInDir' def dir "."
52335233

52345234
withLongTimeout :: IO a -> IO a
52355235
withLongTimeout = bracket_ (setEnv "LSP_TIMEOUT" "120" True) (unsetEnv "LSP_TIMEOUT")
52365236

52375237
-- | Takes a directory as well as relative paths to where we should launch the executable as well as the session root.
5238-
runInDir' :: IDE.Arguments -> FilePath -> FilePath -> FilePath -> Session a -> IO a
5239-
runInDir' args dir startExeIn startSessionIn s = do
5240-
let startDir = dir </> startExeIn
5238+
runInDir' :: IDE.Arguments -> FilePath -> FilePath -> Session a -> IO a
5239+
runInDir' args dir startSessionIn s = do
52415240
let projDir = dir </> startSessionIn
52425241

5243-
createDirectoryIfMissing True startDir
52445242
createDirectoryIfMissing True projDir
5245-
-- Temporarily hack around https://github.com/mpickering/hie-bios/pull/56
5246-
-- since the package import test creates "Data/List.hs", which otherwise has no physical home
5247-
createDirectoryIfMissing True $ projDir ++ "/Data"
52485243
-- HIE calls getXgdDirectory which assumes that HOME is set.
52495244
-- Only sets HOME if it wasn't already set.
52505245
setEnv "HOME" "/homeless-shelter" False
52515246

5252-
testIde dir args s
5247+
testIde projDir args s
52535248

52545249
getConfigFromEnv ::IO SessionConfig
52555250
getConfigFromEnv = do
@@ -5386,7 +5381,7 @@ testIde rootDir arguments session = do
53865381
sleep 1
53875382
runIt
53885383

5389-
hClose hInWrite
5384+
-- hClose hInWrite
53905385
timeout 3 (wait server) >>= \case
53915386
Just () -> pure ()
53925387
Nothing -> do

0 commit comments

Comments
 (0)