X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=test%2FParsingTests.hs;h=31bcfefd7a882c1620cc4d71fed58e7c4702c191;hb=edee40c4aba2607c652cace2da780c373612665f;hp=7824ef3b4f7ff930388b7f3ebcd53274c21f901d;hpb=88c70a40654c7152fb50b2a4e171fbdc00324f51;p=opengl.git diff --git a/test/ParsingTests.hs b/test/ParsingTests.hs index 7824ef3..31bcfef 100644 --- a/test/ParsingTests.hs +++ b/test/ParsingTests.hs @@ -9,6 +9,8 @@ import Data.Conduit import Data.Conduit.Parser import Test.Hspec +type TestSession = ConduitParser FromServerMessage IO + parsingSpec :: Spec parsingSpec = describe "diagnostics" $ do @@ -18,10 +20,9 @@ parsingSpec = (PublishDiagnosticsParams (Uri "foo") (List []))) it "get picked up" $ do - let - source = yield testDiag + let source = yield testDiag session = do - diags <- 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 @@ -33,6 +34,6 @@ parsingSpec = notTestDiag = NotLogMessage (NotificationMessage "2.0" WindowLogMessage (LogMessageParams MtLog "foo")) source = yield notTestDiag >> yield testDiag session = do - diags <- skipManyTill notification publishDiagnosticsNotification + diags <- skipManyTill anyNotification notification :: TestSession PublishDiagnosticsNotification return $ diags ^. params . uri runConduit (source .| runConduitParser session) `shouldReturn` Uri "foo"