Add test for failing replay
[opengl.git] / test / Test.hs
index 13e7ccc5d3066b687c7ca4391a3e6e8af62cbe77..1fd58da97d33508f47683c03194ef191076e5553 100644 (file)
@@ -14,10 +14,7 @@ main = hspec $ do
   describe "manual session validation" $ 
     it "passes a test" $
       runSession "test/recordings/renamePass" $ do
-        docItem <- getDocItem "Desktop/simple.hs" "haskell"
-        docId   <- TextDocumentIdentifier <$> getDocUri "Desktop/simple.hs"
-
-        sendNotification TextDocumentDidOpen (DidOpenTextDocumentParams docItem)
+        doc <- openDoc "Desktop/simple.hs" "haskell"
 
         skipMany loggingNotification
 
@@ -27,7 +24,7 @@ main = hspec $ do
         
         sendRequest (Proxy :: Proxy DocumentSymbolRequest)
                     TextDocumentDocumentSymbol
-                    (DocumentSymbolParams docId)
+                    (DocumentSymbolParams doc)
 
         RspDocumentSymbols rspSymbols <- response
         
@@ -39,6 +36,8 @@ main = hspec $ do
           mainSymbol ^. location . range `shouldBe` Range (Position 3 0) (Position 3 4)
           mainSymbol ^. containerName `shouldBe` Nothing
   
-  describe "replay session" $
+  describe "replay session" $ do
     it "passes a test" $
       replaySession "test/recordings/renamePass" `shouldReturn` True
+    it "fails a test" $
+      replaySession "test/recordings/renameFail" `shouldReturn` False
\ No newline at end of file