+ it "throw when there's an unexpected message" $
+ let msgExc (UnexpectedMessageException "Publish diagnostics notification" (NotLogMessage _)) = True
+ msgExc _ = False
+ in runSession "hie --lsp" "test/data/renamePass" publishDiagnosticsNotification `shouldThrow` msgExc
+
+ it "throw when there's an unexpected message 2" $
+ let msgExc (UnexpectedMessageException "Response" (NotPublishDiagnostics _)) = True
+ msgExc _ = False
+ sesh = do
+ doc <- openDoc "Desktop/simple.hs" "haskell"
+ sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams doc)
+ skipMany anyNotification
+ response :: Session RenameResponse -- the wrong type
+ in runSession "hie --lsp" "test/data/renamePass" sesh
+ `shouldThrow` msgExc