X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=test%2FTest.hs;h=eb0eef0f269493d3fe3e1b95d0fc4d1210f9fffd;hb=2ba261a93d4d1aebb3f749d65e7ad038fe1fb8ce;hp=ed8c6b5f5f0c6ce0e8d2b88fd8bbe40bcf0f7efb;hpb=14966566f56badb30e257defe62463e484a2892a;p=lsp-test.git diff --git a/test/Test.hs b/test/Test.hs index ed8c6b5..eb0eef0 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" $ @@ -46,7 +44,7 @@ main = hspec $ do describe "withTimeout" $ do it "times out" $ - let sesh = runSession "hie -d --bios-verbose" fullCaps "test/data/renamePass" $ do + let sesh = runSession "hie" fullCaps "test/data/renamePass" $ do openDoc "Desktop/simple.hs" "haskell" -- won't receive a request - will timeout -- incoming logging requests shouldn't increase the @@ -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