From e20702337b097d65d023501afc82fb25b14465a9 Mon Sep 17 00:00:00 2001 From: Sandy Maguire Date: Wed, 21 Oct 2020 01:13:11 -0700 Subject: [PATCH] Wait for diagnostics in tactics tests --- test/functional/Tactic.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/functional/Tactic.hs b/test/functional/Tactic.hs index 275e1b68fe..cf6e564493 100644 --- a/test/functional/Tactic.hs +++ b/test/functional/Tactic.hs @@ -122,6 +122,7 @@ mkTest name fp line col ts = testCase name $ do runSession hlsCommand fullCaps tacticPath $ do doc <- openDoc fp "haskell" + _ <- waitForDiagnostics actions <- getCodeActions doc $ pointRange line col let titles = mapMaybe codeActionTitle actions for_ ts $ \(f, tc, var) -> do @@ -136,6 +137,7 @@ goldenTest input line col tc occ = testCase (input <> " (golden)") $ do runSession hlsCommand fullCaps tacticPath $ do doc <- openDoc input "haskell" + _ <- waitForDiagnostics actions <- getCodeActions doc $ pointRange line col Just (CACodeAction (CodeAction {_command = Just c})) <- pure $ find ((== Just (tacticTitle tc occ)) . codeActionTitle) actions