summaryrefslogtreecommitdiff
path: root/tests/Language/GraphQL/THSpec.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2024-12-03 20:41:40 +0100
committerEugen Wissner <belka@caraus.de>2024-12-03 20:41:40 +0100
commit131576e56cb4981938320569dfcf1ca814d8a42a (patch)
tree5e46d13f22aa9a0bdd672f3d24e1f8961de5f010 /tests/Language/GraphQL/THSpec.hs
parentc95a5fcd610e3fb816058e8341caf774686f9c82 (diff)
downloadgraphql-spice-131576e56cb4981938320569dfcf1ca814d8a42a.tar.gz
Move gql to Language.GraphQL.TH
Diffstat (limited to 'tests/Language/GraphQL/THSpec.hs')
-rw-r--r--tests/Language/GraphQL/THSpec.hs28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/Language/GraphQL/THSpec.hs b/tests/Language/GraphQL/THSpec.hs
new file mode 100644
index 0000000..ffa6db6
--- /dev/null
+++ b/tests/Language/GraphQL/THSpec.hs
@@ -0,0 +1,28 @@
+{- This Source Code Form is subject to the terms of the Mozilla Public License,
+ v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ obtain one at https://mozilla.org/MPL/2.0/. -}
+
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE QuasiQuotes #-}
+{-# LANGUAGE PackageImports #-}
+
+module Language.GraphQL.THSpec
+ ( spec
+ ) where
+
+import Data.Text (Text)
+import "graphql-spice" Language.GraphQL.TH (gql)
+import Test.Hspec (Spec, describe, it, shouldBe)
+
+spec :: Spec
+spec = do
+ describe "gql" $
+ it "replaces CRNL with NL" $
+ let expected :: Text
+ expected = "line1\nline2\nline3"
+ actual = [gql|
+ line1
+ line2
+ line3
+ |]
+ in actual `shouldBe` expected