X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=test%2FTest.hs;h=426dd6bd704f3df283e2f19e7ac08609697211d9;hb=bc52b000bf018360efbfa0fcd289329c70d2c77e;hp=c7e67131d914875b1fb41f98cb8928b8dba1f7e5;hpb=4eb97ef8a3d4b3908fa9b5bbbd5ae77cfa95cecc;p=lsp-test.git diff --git a/test/Test.hs b/test/Test.hs index c7e6713..426dd6b 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -2,32 +2,28 @@ {-# LANGUAGE OverloadedStrings #-} import Test.Hspec import Data.Maybe -import Data.Proxy import Control.Monad.IO.Class import Control.Lens hiding (List) import Language.Haskell.LSP.Test import Language.Haskell.LSP.Test.Replay import Language.Haskell.LSP.Types -import Language.Haskell.LSP.Messages import ParsingTests main = hspec $ do - describe "manual session validation" $ do + describe "manual session" $ do it "passes a test" $ runSession "hie" "test/recordings/renamePass" $ do doc <- openDoc "Desktop/simple.hs" "haskell" skipMany loggingNotification - NotPublishDiagnostics diagsNot <- notification + diagsNot <- notification :: Session PublishDiagnosticsNotification liftIO $ diagsNot ^. params . diagnostics `shouldBe` List [] - sendRequest (Proxy :: Proxy DocumentSymbolRequest) - TextDocumentDocumentSymbol - (DocumentSymbolParams doc) + sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams doc) - RspDocumentSymbols rspSymbols <- response + rspSymbols <- response :: Session DocumentSymbolsResponse liftIO $ do let (List symbols) = fromJust (rspSymbols ^. result) @@ -42,7 +38,7 @@ main = hspec $ do let session = runSession "hie" "test/recordings/renamePass" $ do openDoc "Desktop/simple.hs" "haskell" skipMany loggingNotification - request + anyRequest in session `shouldThrow` anyException describe "replay session" $ do