X-Git-Url: https://git.lukelau.me/?a=blobdiff_plain;f=test%2FTest.hs;h=db5124633b7582ea93f593cb2e2d59993e50396b;hb=358ddf1c3f5138c2ddf5f40d6ab543ab6ea75f27;hp=ed8c6b5f5f0c6ce0e8d2b88fd8bbe40bcf0f7efb;hpb=14966566f56badb30e257defe62463e484a2892a;p=lsp-test.git diff --git a/test/Test.hs b/test/Test.hs index ed8c6b5..db51246 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -16,7 +16,7 @@ import Control.Monad import Control.Lens hiding (List) import GHC.Generics import Language.Haskell.LSP.Messages -import Language.Haskell.LSP.Test hiding (runSession) +import Language.Haskell.LSP.Test import Language.Haskell.LSP.Test.Replay import Language.Haskell.LSP.Types import Language.Haskell.LSP.Types.Lens as LSP hiding @@ -27,8 +27,6 @@ import System.Timeout {-# ANN module ("HLint: ignore Reduce duplication" :: String) #-} {-# ANN module ("HLint: ignore Unnecessary hiding" :: String) #-} -runSession = runSessionWithConfig (defaultConfig { logStdErr = True }) - main = hspec $ do describe "Session" $ do it "fails a test" $ @@ -283,11 +281,18 @@ main = hspec $ do diag ^. severity `shouldBe` Just DsError diag ^. source `shouldBe` Just "bios" - describe "rename" $ - it "works" $ runSession "hie" fullCaps "test/data" $ do - doc <- openDoc "Rename.hs" "haskell" - rename doc (Position 1 0) "bar" - documentContents doc >>= liftIO . shouldBe "main = bar\nbar = return 42\n" + describe "rename" $ do + it "works" $ pendingWith "HaRe not in hie-bios yet" + it "works on javascript" $ + runSession "javascript-typescript-stdio" fullCaps "test/data/javascriptPass" $ do + doc <- openDoc "test.js" "javascript" + rename doc (Position 2 11) "bar" + documentContents doc >>= liftIO . (`shouldContain` "function bar()") . T.unpack + + -- runSession "hie" fullCaps "test/data" $ do + -- doc <- openDoc "Rename.hs" "haskell" + -- rename doc (Position 1 0) "bar" + -- documentContents doc >>= liftIO . shouldBe "main = bar\nbar = return 42\n" describe "getHover" $ it "works" $ runSession "hie" fullCaps "test/data/renamePass" $ do