@@ -5493,12 +5493,10 @@ simpleMultiTest :: TestTree
5493
5493
simpleMultiTest = testCase " simple-multi-test" $ withLongTimeout $ runWithExtraFiles " multi" $ \ dir -> do
5494
5494
let aPath = dir </> " a/A.hs"
5495
5495
bPath = dir </> " b/B.hs"
5496
- aSource <- liftIO $ readFileUtf8 aPath
5497
- adoc <- createDoc aPath " haskell" aSource
5496
+ adoc <- openDoc aPath " haskell "
5497
+ bdoc <- openDoc bPath " haskell"
5498
5498
WaitForIdeRuleResult {.. } <- waitForAction " TypeCheck" adoc
5499
5499
liftIO $ assertBool " A should typecheck" ideResultSuccess
5500
- bSource <- liftIO $ readFileUtf8 bPath
5501
- bdoc <- createDoc bPath " haskell" bSource
5502
5500
WaitForIdeRuleResult {.. } <- waitForAction " TypeCheck" bdoc
5503
5501
liftIO $ assertBool " B should typecheck" ideResultSuccess
5504
5502
locs <- getDefinitions bdoc (Position 2 7 )
@@ -5511,15 +5509,14 @@ simpleMultiTest2 :: TestTree
5511
5509
simpleMultiTest2 = testCase " simple-multi-test2" $ runWithExtraFiles " multi" $ \ dir -> do
5512
5510
let aPath = dir </> " a/A.hs"
5513
5511
bPath = dir </> " b/B.hs"
5514
- bSource <- liftIO $ readFileUtf8 bPath
5515
- bdoc <- createDoc bPath " haskell" bSource
5516
- expectNoMoreDiagnostics 10
5517
- aSource <- liftIO $ readFileUtf8 aPath
5518
- (TextDocumentIdentifier adoc) <- createDoc aPath " haskell" aSource
5519
- -- Need to have some delay here or the test fails
5520
- expectNoMoreDiagnostics 10
5512
+ bdoc <- openDoc bPath " haskell"
5513
+ WaitForIdeRuleResult {} <- waitForAction " TypeCheck" bdoc
5514
+ adoc@ (TextDocumentIdentifier auri) <- openDoc aPath " haskell"
5515
+ WaitForIdeRuleResult {} <- waitForAction " TypeCheck" adoc
5521
5516
locs <- getDefinitions bdoc (Position 2 7 )
5522
- let fooL = mkL adoc 2 0 2 3
5517
+ let fooL = mkL auri 2 0 2 3
5518
+ checkDefs locs (pure [fooL])
5519
+ expectNoMoreDiagnostics 0.5
5523
5520
checkDefs locs (pure [fooL])
5524
5521
expectNoMoreDiagnostics 0.5
5525
5522
0 commit comments