This commit is contained in:
2019-09-06 07:48:01 +02:00
parent 63d4de485d
commit 1704022e74
3 changed files with 17 additions and 2 deletions

View File

@ -1,4 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module Language.GraphQL.ParserSpec
( spec
) where
@ -11,8 +12,19 @@ import Test.Hspec ( Spec
, shouldSatisfy
)
import Text.Megaparsec (parse)
import Text.RawString.QQ (r)
spec :: Spec
spec = describe "Parser" $
spec = describe "Parser" $ do
it "accepts BOM header" $
parse document "" "\xfeff{foo}" `shouldSatisfy` isRight
it "accepts block strings as argument" $
parse document "" [r|{
hello(text: """Argument""")
}|] `shouldSatisfy` isRight
it "accepts strings as argument" $
parse document "" [r|{
hello(text: "Argument")
}|] `shouldSatisfy` isRight