From: Luke Lau Date: Fri, 20 Dec 2019 00:01:01 +0000 (+0000) Subject: Merge branch 'master' into github-actions X-Git-Url: https://git.lukelau.me/?a=commitdiff_plain;h=14966566f56badb30e257defe62463e484a2892a;hp=-c;p=lsp-test.git Merge branch 'master' into github-actions --- 14966566f56badb30e257defe62463e484a2892a diff --combined test/Test.hs index 22f8e21,dc770d9..ed8c6b5 --- a/test/Test.hs +++ b/test/Test.hs @@@ -16,7 -16,7 +16,7 @@@ import Control.Mona import Control.Lens hiding (List) import GHC.Generics import Language.Haskell.LSP.Messages -import Language.Haskell.LSP.Test +import Language.Haskell.LSP.Test hiding (runSession) import Language.Haskell.LSP.Test.Replay import Language.Haskell.LSP.Types import Language.Haskell.LSP.Types.Lens as LSP hiding @@@ -27,8 -27,6 +27,8 @@@ import System.Timeou {-# 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 +46,7 @@@ describe "withTimeout" $ do it "times out" $ - let sesh = runSession "hie" fullCaps "test/data/renamePass" $ do + let sesh = runSession "hie -d --bios-verbose" fullCaps "test/data/renamePass" $ do openDoc "Desktop/simple.hs" "haskell" -- won't receive a request - will timeout -- incoming logging requests shouldn't increase the @@@ -93,7 -91,9 +93,9 @@@ getDocumentSymbols doc -- should now timeout skipManyTill anyMessage message :: Session ApplyWorkspaceEditRequest - in sesh `shouldThrow` (== Timeout) + isTimeout (Timeout _) = True + isTimeout _ = False + in sesh `shouldThrow` isTimeout describe "SessionException" $ do @@@ -333,6 -333,12 +335,12 @@@ pred _ = False void $ satisfy pred + describe "ignoreLogNotifications" $ + it "works" $ + runSessionWithConfig (defaultConfig { ignoreLogNotifications = True }) "hie" fullCaps "test/data" $ do + openDoc "Format.hs" "haskell" + void publishDiagnosticsNotification + mkRange sl sc el ec = Range (Position sl sc) (Position el ec) didChangeCaps :: ClientCapabilities