@@ -5484,12 +5484,10 @@ simpleMultiTest :: TestTree
5484
5484
simpleMultiTest = testCase " simple-multi-test" $ withLongTimeout $ runWithExtraFiles " multi" $ \ dir -> do
5485
5485
let aPath = dir </> " a/A.hs"
5486
5486
bPath = dir </> " b/B.hs"
5487
- aSource <- liftIO $ readFileUtf8 aPath
5488
- adoc <- createDoc aPath " haskell" aSource
5487
+ adoc <- openDoc aPath " haskell "
5488
+ bdoc <- openDoc bPath " haskell"
5489
5489
WaitForIdeRuleResult {.. } <- waitForAction " TypeCheck" adoc
5490
5490
liftIO $ assertBool " A should typecheck" ideResultSuccess
5491
- bSource <- liftIO $ readFileUtf8 bPath
5492
- bdoc <- createDoc bPath " haskell" bSource
5493
5491
WaitForIdeRuleResult {.. } <- waitForAction " TypeCheck" bdoc
5494
5492
liftIO $ assertBool " B should typecheck" ideResultSuccess
5495
5493
locs <- getDefinitions bdoc (Position 2 7 )
@@ -5502,15 +5500,14 @@ simpleMultiTest2 :: TestTree
5502
5500
simpleMultiTest2 = testCase " simple-multi-test2" $ runWithExtraFiles " multi" $ \ dir -> do
5503
5501
let aPath = dir </> " a/A.hs"
5504
5502
bPath = dir </> " b/B.hs"
5505
- bSource <- liftIO $ readFileUtf8 bPath
5506
- bdoc <- createDoc bPath " haskell" bSource
5507
- expectNoMoreDiagnostics 10
5508
- aSource <- liftIO $ readFileUtf8 aPath
5509
- (TextDocumentIdentifier adoc) <- createDoc aPath " haskell" aSource
5510
- -- Need to have some delay here or the test fails
5511
- expectNoMoreDiagnostics 10
5503
+ bdoc <- openDoc bPath " haskell"
5504
+ WaitForIdeRuleResult {} <- waitForAction " TypeCheck" bdoc
5505
+ adoc@ (TextDocumentIdentifier auri) <- openDoc aPath " haskell"
5506
+ WaitForIdeRuleResult {} <- waitForAction " TypeCheck" adoc
5512
5507
locs <- getDefinitions bdoc (Position 2 7 )
5513
- let fooL = mkL adoc 2 0 2 3
5508
+ let fooL = mkL auri 2 0 2 3
5509
+ checkDefs locs (pure [fooL])
5510
+ expectNoMoreDiagnostics 0.5
5514
5511
checkDefs locs (pure [fooL])
5515
5512
expectNoMoreDiagnostics 0.5
5516
5513
0 commit comments