Skip to content

Commit cd0b615

Browse files
committed
Make test resilient to default diags
1 parent 7759c08 commit cd0b615

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

test/functional/FunctionalCodeAction.hs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,17 @@ hlintTests = testGroup "hlint suggestions" [
8888
let config = def { hlintOn = True }
8989
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config))
9090

91-
doc <- openDoc "ApplyRefact2.hs" "haskell"
92-
diags <- waitForDiagnosticsSource "hlint"
91+
_ <- openDoc "ApplyRefact2.hs" "haskell"
92+
diags <- waitForDiagnostics
9393

94-
liftIO $ length diags @?= 2
94+
liftIO $ (Just "hlint" `elem` map (^. L.source) diags) @? "There are hlint diagnostics"
9595

9696
let config' = def { hlintOn = False }
9797
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (toJSON config'))
9898

99-
_ <- waitForDiagnosticsSource "typecheck"
100-
diags' <- getCurrentDiagnostics doc
99+
diags' <- waitForDiagnostics
101100

102-
liftIO $ length diags' @?= 1 -- typecheck diagnostic "Defined but not used"
101+
liftIO $ (not $ Just "hlint" `elem` map (^. L.source) diags') @? "There are not hlint diagnostics"
103102

104103
]
105104

0 commit comments

Comments
 (0)