summaryrefslogtreecommitdiff
path: root/tests/Language/GraphQL/THSpec.hs
blob: ffa6db64d1f8d46fa68377c8bb8fe0bf997d1438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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