replace expectNoMoreDiagnostics with waitForAction's, saving 1s

This commit is contained in:
komikat 2024-06-21 21:56:54 +05:30
parent f523690ada
commit 4507bd77bf

View File

@ -110,14 +110,15 @@ pluginTests =
liftIO $ newDiags @?= []
, runCabalTestCaseSession "No Diagnostics in .hs files from valid .cabal file" "simple-cabal" $ do
hsDoc <- openDoc "A.hs" "haskell"
expectNoMoreDiagnostics 1 hsDoc "typechecking"
_ <- waitForTypecheck hsDoc
cabalDoc <- openDoc "simple-cabal.cabal" "cabal"
expectNoMoreDiagnostics 1 cabalDoc "parsing"
_ <- waitForAction "gethieast" cabalDoc
return ()
, runCabalTestCaseSession "Diagnostics in .hs files from invalid .cabal file" "simple-cabal" $ do
hsDoc <- openDoc "A.hs" "haskell"
expectNoMoreDiagnostics 1 hsDoc "typechecking"
_ <- waitForTypecheck hsDoc
cabalDoc <- openDoc "simple-cabal.cabal" "cabal"
expectNoMoreDiagnostics 1 cabalDoc "parsing"
_ <- waitForAction "gethieast" cabalDoc
let theRange = Range (Position 3 20) (Position 3 23)
-- Invalid license
changeDoc
@ -131,7 +132,7 @@ pluginTests =
]
cabalDiags <- waitForDiagnosticsFrom cabalDoc
unknownLicenseDiag <- liftIO $ inspectDiagnostic cabalDiags ["Unknown SPDX license identifier: 'MIT3'"]
expectNoMoreDiagnostics 1 hsDoc "typechecking"
_ <- waitForTypecheck hsDoc
liftIO $ do
length cabalDiags @?= 1
unknownLicenseDiag ^. L.range @?= Range (Position 3 24) (Position 4 0)