forked from OSS/graphql
parent
7b92e5bcfd
commit
73e21661b4
@ -89,12 +89,12 @@ symbol :: T.Text -> Parser T.Text
|
||||
symbol = Lexer.symbol spaceConsumer
|
||||
|
||||
-- | Parser for "!".
|
||||
bang :: Parser Char
|
||||
bang = char '!'
|
||||
bang :: Parser T.Text
|
||||
bang = symbol "!"
|
||||
|
||||
-- | Parser for "$".
|
||||
dollar :: Parser Char
|
||||
dollar = char '$'
|
||||
dollar :: Parser T.Text
|
||||
dollar = symbol "$"
|
||||
|
||||
-- | Parser for "@".
|
||||
at :: Parser Char
|
||||
|
@ -71,8 +71,8 @@ spec = describe "Lexer" $ do
|
||||
parse float "" "-1.123e4567" `shouldParse` (-1.123e4567)
|
||||
|
||||
it "lexes punctuation" $ do
|
||||
parse bang "" "!" `shouldParse` '!'
|
||||
parse dollar "" "$" `shouldParse` '$'
|
||||
parse bang "" "!" `shouldParse` "!"
|
||||
parse dollar "" "$" `shouldParse` "$"
|
||||
runBetween parens `shouldSucceedOn` "()"
|
||||
parse spread "" "..." `shouldParse` "..."
|
||||
parse colon "" ":" `shouldParse` ":"
|
||||
|
@ -24,3 +24,9 @@ spec = describe "Parser" $ do
|
||||
parse document "" `shouldSucceedOn` [r|{
|
||||
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