diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Language/GraphQL/ParserSpec.hs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/Language/GraphQL/ParserSpec.hs b/tests/Language/GraphQL/ParserSpec.hs index c412c85..6425ea5 100644 --- a/tests/Language/GraphQL/ParserSpec.hs +++ b/tests/Language/GraphQL/ParserSpec.hs @@ -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 |
