Skip to content

Commit f8dc9e0

Browse files
committed
Wait for hlint diagnostics explicitly
1 parent 3adb995 commit f8dc9e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/functional/FunctionalCodeAction.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ hlintTests = testGroup "hlint suggestions" [
7171
, testCase "falls back to pre 3.8 code actions" $ runSession hlsCommand noLiteralCaps "test/testdata/hlint" $ do
7272
doc <- openDoc "ApplyRefact2.hs" "haskell"
7373

74-
_ <- waitForDiagnostics
74+
_ <- waitForDiagnosticsSource "hlint"
7575

7676
(CACommand cmd:_) <- getAllCodeActions doc
7777

@@ -85,16 +85,16 @@ hlintTests = testGroup "hlint suggestions" [
8585
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))
8686

8787
_ <- openDoc "ApplyRefact2.hs" "haskell"
88-
diags <- waitForDiagnostics
88+
diags <- waitForDiagnosticsSource "hlint"
8989

90-
liftIO $ (Just "hlint" `elem` map (^. L.source) diags) @? "There are hlint diagnostics"
90+
liftIO $ length diags > 0 @? "There are hlint diagnostics"
9191

9292
let config' = def { hlintOn = False }
9393
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config'))
9494

9595
diags' <- waitForDiagnostics
9696

97-
liftIO $ (not $ Just "hlint" `elem` map (^. L.source) diags') @? "There are not hlint diagnostics"
97+
liftIO $ (not $ Just "hlint" `elem` map (^. L.source) diags') @? "There are no hlint diagnostics"
9898

9999
]
100100

0 commit comments

Comments
 (0)