- replay "test/recordings/documentSymbolFail/client.log"
- "test/recordings/documentSymbolFail/server.log"
- "test/recordings/documentSymbolFail"
- `shouldReturn` False
-
- -- describe "file swapping" $ do
- -- it "gets the base directory" $ do
- -- h <- openFile "test/recordings/renamePass/client.log" ReadMode
- -- msgs <- getAllMessages h
- -- rootDir msgs `shouldBe` "/Users/luke/Desktop"
-
- -- it "gets builds a mapping of files" $ do
- -- h <- openFile "test/recordings/renamePass/client.log" ReadMode
- -- msgs <- getAllMessages h
- -- let root = rootDir msgs
- -- swapped <- swapFiles root "test/recordings/renamePass/" msgs
- -- let (Just n) = decode (swapped !! 3) :: Maybe LSP.DidOpenNotification
-
- -- cd <- getCurrentDirectory
-
- -- n .^ params . uri `shouldBe` LSP.uriFromFilePath (cd </> "test/recordings/renamePass/")
+ -- TODO: Catch the exception in haskell-lsp-test and provide nicer output
+ let session = runSession "hie --lsp" "test/recordings/renamePass" $ do
+ openDoc "Desktop/simple.hs" "haskell"
+ skipMany loggingNotification
+ anyRequest
+ in session `shouldThrow` anyException
+
+ describe "replay session" $ do
+ it "passes a test" $
+ replaySession "hie --lsp" "test/recordings/renamePass" `shouldReturn` True
+ it "fails a test" $
+ replaySession "hie --lsp" "test/recordings/renameFail" `shouldReturn` False
+
+ parsingSpec