forked from OSS/graphql
parent
7b92e5bcfd
commit
73e21661b4
@ -89,12 +89,12 @@ symbol :: T.Text -> Parser T.Text
|
|||||||
symbol = Lexer.symbol spaceConsumer
|
symbol = Lexer.symbol spaceConsumer
|
||||||
|
|
||||||
-- | Parser for "!".
|
-- | Parser for "!".
|
||||||
bang :: Parser Char
|
bang :: Parser T.Text
|
||||||
bang = char '!'
|
bang = symbol "!"
|
||||||
|
|
||||||
-- | Parser for "$".
|
-- | Parser for "$".
|
||||||
dollar :: Parser Char
|
dollar :: Parser T.Text
|
||||||
dollar = char '$'
|
dollar = symbol "$"
|
||||||
|
|
||||||
-- | Parser for "@".
|
-- | Parser for "@".
|
||||||
at :: Parser Char
|
at :: Parser Char
|
||||||
|
@ -71,8 +71,8 @@ spec = describe "Lexer" $ do
|
|||||||
parse float "" "-1.123e4567" `shouldParse` (-1.123e4567)
|
parse float "" "-1.123e4567" `shouldParse` (-1.123e4567)
|
||||||
|
|
||||||
it "lexes punctuation" $ do
|
it "lexes punctuation" $ do
|
||||||
parse bang "" "!" `shouldParse` '!'
|
parse bang "" "!" `shouldParse` "!"
|
||||||
parse dollar "" "$" `shouldParse` '$'
|
parse dollar "" "$" `shouldParse` "$"
|
||||||
runBetween parens `shouldSucceedOn` "()"
|
runBetween parens `shouldSucceedOn` "()"
|
||||||
parse spread "" "..." `shouldParse` "..."
|
parse spread "" "..." `shouldParse` "..."
|
||||||
parse colon "" ":" `shouldParse` ":"
|
parse colon "" ":" `shouldParse` ":"
|
||||||
|
@ -24,3 +24,9 @@ spec = describe "Parser" $ do
|
|||||||
parse document "" `shouldSucceedOn` [r|{
|
parse document "" `shouldSucceedOn` [r|{
|
||||||
hello(text: "Argument")
|
hello(text: "Argument")
|
||||||
}|]
|
}|]
|
||||||
|
|
||||||
|
it "accepts two required arguments" $
|
||||||
|
parse document "" `shouldSucceedOn` [r|
|
||||||
|
mutation auth($username: String!, $password: String!){
|
||||||
|
test
|
||||||
|
}|]
|
||||||
|
Loading…
Reference in New Issue
Block a user