From 4c10ce92041dc73a95aeb64aca241dd937ffaa5c Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Mon, 14 Sep 2020 07:49:33 +0200 Subject: Use Seq as base monad in the validator It is more natural to implement the logic: try to apply each rule to each node. --- tests/Language/GraphQL/AST/EncoderSpec.hs | 8 ++++---- tests/Language/GraphQL/AST/LexerSpec.hs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/Language') diff --git a/tests/Language/GraphQL/AST/EncoderSpec.hs b/tests/Language/GraphQL/AST/EncoderSpec.hs index 9326fd1..b21e68f 100644 --- a/tests/Language/GraphQL/AST/EncoderSpec.hs +++ b/tests/Language/GraphQL/AST/EncoderSpec.hs @@ -121,11 +121,11 @@ spec = do describe "definition" $ it "indents block strings in arguments" $ - let arguments = [Argument "message" (String "line1\nline2")] - field = Field Nothing "field" arguments [] [] $ Location 0 0 + let location = Location 0 0 + arguments = [Argument "message" (String "line1\nline2") location] + field = Field Nothing "field" arguments [] [] location operation = DefinitionOperation - $ SelectionSet (pure $ FieldSelection field) - $ Location 0 0 + $ SelectionSet (pure $ FieldSelection field) location in definition pretty operation `shouldBe` [r|{ field(message: """ line1 diff --git a/tests/Language/GraphQL/AST/LexerSpec.hs b/tests/Language/GraphQL/AST/LexerSpec.hs index 0b4cb31..5649d2d 100644 --- a/tests/Language/GraphQL/AST/LexerSpec.hs +++ b/tests/Language/GraphQL/AST/LexerSpec.hs @@ -75,7 +75,7 @@ spec = describe "Lexer" $ do parse dollar "" "$" `shouldParse` "$" runBetween parens `shouldSucceedOn` "()" parse spread "" "..." `shouldParse` "..." - parse colon "" ":" `shouldParse` ":" + parse colon "" `shouldSucceedOn` ":" parse equals "" "=" `shouldParse` "=" parse at "" "@" `shouldParse` "@" runBetween brackets `shouldSucceedOn` "[]" -- cgit v1.2.3