summaryrefslogtreecommitdiff
path: root/tests/Language
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2020-09-14 07:49:33 +0200
committerEugen Wissner <belka@caraus.de>2020-09-15 08:06:07 +0200
commit4c10ce92041dc73a95aeb64aca241dd937ffaa5c (patch)
tree6a1742eaf6ff3ae3a4f4d0e2a3c5afbe9a146f4b /tests/Language
parent08998dbd935e65aab10ff53c249cb214af2522f2 (diff)
downloadgraphql-4c10ce92041dc73a95aeb64aca241dd937ffaa5c.tar.gz
Use Seq as base monad in the validator
It is more natural to implement the logic: try to apply each rule to each node.
Diffstat (limited to 'tests/Language')
-rw-r--r--tests/Language/GraphQL/AST/EncoderSpec.hs8
-rw-r--r--tests/Language/GraphQL/AST/LexerSpec.hs2
2 files changed, 5 insertions, 5 deletions
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` "[]"