projects
/
lsp-test.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7d0ddb8
)
Add type synonym for test version of Session
author
Luke Lau
<luke_lau@icloud.com>
Mon, 11 Jun 2018 16:12:20 +0000
(12:12 -0400)
committer
Luke Lau
<luke_lau@icloud.com>
Mon, 11 Jun 2018 16:12:20 +0000
(12:12 -0400)
test/ParsingTests.hs
patch
|
blob
|
history
diff --git
a/test/ParsingTests.hs
b/test/ParsingTests.hs
index c8977b53e33f6915be4aae84bfa19d0c88b89578..31bcfefd7a882c1620cc4d71fed58e7c4702c191 100644
(file)
--- a/
test/ParsingTests.hs
+++ b/
test/ParsingTests.hs
@@
-9,6
+9,8
@@
import Data.Conduit
import Data.Conduit.Parser
import Test.Hspec
import Data.Conduit.Parser
import Test.Hspec
+type TestSession = ConduitParser FromServerMessage IO
+
parsingSpec :: Spec
parsingSpec =
describe "diagnostics" $ do
parsingSpec :: Spec
parsingSpec =
describe "diagnostics" $ do
@@
-20,7
+22,7
@@
parsingSpec =
it "get picked up" $ do
let source = yield testDiag
session = do
it "get picked up" $ do
let source = yield testDiag
session = do
- diags <- publishDiagnosticsNotification ::
ConduitParser FromServerMessage IO
PublishDiagnosticsNotification
+ diags <- publishDiagnosticsNotification ::
TestSession
PublishDiagnosticsNotification
return $ diags ^. params . uri
runConduit (source .| runConduitParser session) `shouldReturn` Uri "foo"
it "get picked up after skipping others before" $ do
return $ diags ^. params . uri
runConduit (source .| runConduitParser session) `shouldReturn` Uri "foo"
it "get picked up after skipping others before" $ do
@@
-32,6
+34,6
@@
parsingSpec =
notTestDiag = NotLogMessage (NotificationMessage "2.0" WindowLogMessage (LogMessageParams MtLog "foo"))
source = yield notTestDiag >> yield testDiag
session = do
notTestDiag = NotLogMessage (NotificationMessage "2.0" WindowLogMessage (LogMessageParams MtLog "foo"))
source = yield notTestDiag >> yield testDiag
session = do
- diags <- skipManyTill anyNotification notification ::
ConduitParser FromServerMessage IO
PublishDiagnosticsNotification
+ diags <- skipManyTill anyNotification notification ::
TestSession
PublishDiagnosticsNotification
return $ diags ^. params . uri
runConduit (source .| runConduitParser session) `shouldReturn` Uri "foo"
return $ diags ^. params . uri
runConduit (source .| runConduitParser session) `shouldReturn` Uri "foo"