Add getDefinitions
[opengl.git] / test / Test.hs
index 6353e09b99ca5b59503bdad8d65bca5e2ee7ecec..0bd7965e6c28031b96b83d682420268c36fa420e 100644 (file)
@@ -238,6 +238,13 @@ main = hspec $ do
         , mkRange 71 6 71 22
         ]
 
+  describe "getDefinitions" $
+    it "works" $ runSession "hie --lsp" "test/data/renamePass" $ do
+      doc <- openDoc "Desktop/simple.hs" "haskell"
+      let pos = Position 49 25 -- addItem
+      defs <- getDefinitions doc pos
+      liftIO $ defs `shouldBe` [Location (doc ^. uri) (mkRange 28 0 28 7)]
+
   describe "waitForDiagnosticsSource" $
     it "works" $ runSession "hie --lsp" "test/data" $ do
       openDoc "Error.hs" "haskell"