X-Git-Url: https://git.lukelau.me/?a=blobdiff_plain;f=test%2FTest.hs;h=a0d4d0d4c210472ab2b62fdf4d6c356e6a5de917;hb=16501021ea92ae3c84dbfd99a3c2dd631685b49c;hp=d689bff411e53a6603c9812f46ba62825ebe87c6;hpb=f89fb166aab4ceac8f02c39d936f858bbc17be94;p=lsp-test.git diff --git a/test/Test.hs b/test/Test.hs index d689bff..a0d4d0d 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -91,7 +91,9 @@ main = hspec $ do getDocumentSymbols doc -- should now timeout skipManyTill anyMessage message :: Session ApplyWorkspaceEditRequest - in sesh `shouldThrow` (== Timeout) + isTimeout (Timeout _) = True + isTimeout _ = False + in sesh `shouldThrow` isTimeout describe "SessionException" $ do @@ -238,7 +240,8 @@ main = hspec $ do noDiagnostics noDiagnostics - item:_ <- getCompletions doc (Position 5 5) + comps <- getCompletions doc (Position 5 5) + let item = head (filter (\x -> x ^. label == "interactWithUser") comps) liftIO $ do item ^. label `shouldBe` "interactWithUser" item ^. kind `shouldBe` Just CiFunction @@ -273,10 +276,10 @@ main = hspec $ do describe "waitForDiagnosticsSource" $ it "works" $ runSession "hie" fullCaps "test/data" $ do openDoc "Error.hs" "haskell" - [diag] <- waitForDiagnosticsSource "ghcmod" + [diag] <- waitForDiagnosticsSource "bios" liftIO $ do diag ^. severity `shouldBe` Just DsError - diag ^. source `shouldBe` Just "ghcmod" + diag ^. source `shouldBe` Just "bios" describe "rename" $ it "works" $ runSession "hie" fullCaps "test/data" $ do