X-Git-Url: http://git.lukelau.me/?p=opengl.git;a=blobdiff_plain;f=test%2FTest.hs;h=d524ee4ffe15c666c8feaabdd5c518e804782a58;hp=1775765ba641a14314bdfd66e309aab007e328b0;hb=9dbcb47a59e389b2dcc4e86cde6b626a2f17e38a;hpb=4c5ad9975b44f2a0482d98c1e67f2de78e7dd0ca diff --git a/test/Test.hs b/test/Test.hs index 1775765..d524ee4 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -18,7 +18,6 @@ import GHC.Generics import Language.Haskell.LSP.Messages import Language.Haskell.LSP.Test import Language.Haskell.LSP.Test.Replay -import Language.Haskell.LSP.Types.Capabilities import Language.Haskell.LSP.Types as LSP hiding (capabilities, message) import System.Timeout @@ -134,7 +133,7 @@ main = hspec $ do noDiagnostics - (fooSymbol:_) <- getDocumentSymbols doc + Right (fooSymbol:_) <- getDocumentSymbols doc liftIO $ do fooSymbol ^. name `shouldBe` "foo" @@ -183,7 +182,7 @@ main = hspec $ do _ <- waitForDiagnostics actions <- getAllCodeActions doc liftIO $ do - let [CommandOrCodeActionCodeAction action] = actions + let [CACodeAction action] = actions action ^. title `shouldBe` "Apply hint:Redundant bracket" action ^. command . _Just . command `shouldSatisfy` T.isSuffixOf ":applyrefact:applyOne" @@ -195,13 +194,12 @@ main = hspec $ do noDiagnostics - (mainSymbol:_) <- getDocumentSymbols doc + Left (mainSymbol:_) <- getDocumentSymbols doc liftIO $ do mainSymbol ^. name `shouldBe` "main" mainSymbol ^. kind `shouldBe` SkFunction - mainSymbol ^. location . range `shouldBe` Range (Position 3 0) (Position 3 4) - mainSymbol ^. containerName `shouldBe` Nothing + mainSymbol ^. range `shouldBe` Range (Position 3 0) (Position 3 4) describe "applyEdit" $ do it "increments the version" $ runSession "hie --lsp" docChangesCaps "test/data/renamePass" $ do