forked from OSS/graphql
parent
82a380079c
commit
ee0e0c3d1f
@ -16,6 +16,8 @@ build-type: Simple
|
|||||||
cabal-version: >=1.10
|
cabal-version: >=1.10
|
||||||
tested-with: GHC == 7.10
|
tested-with: GHC == 7.10
|
||||||
extra-source-files: README.md CHANGELOG.md stack.yaml
|
extra-source-files: README.md CHANGELOG.md stack.yaml
|
||||||
|
data-files: tests/data/*.graphql
|
||||||
|
tests/data/*.graphql.golden
|
||||||
|
|
||||||
library
|
library
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
@ -8,14 +8,14 @@ import qualified Data.Text.IO as TIO
|
|||||||
import Test.Tasty (defaultMain)
|
import Test.Tasty (defaultMain)
|
||||||
import Test.Tasty.Golden (goldenVsString)
|
import Test.Tasty.Golden (goldenVsString)
|
||||||
|
|
||||||
|
import Paths_graphql (getDataFileName)
|
||||||
import Data.GraphQL.Parser (document)
|
import Data.GraphQL.Parser (document)
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = defaultMain
|
main = defaultMain
|
||||||
$ goldenVsString "kitchen-sink.graphql"
|
=<< goldenVsString "kitchen-sink.graphql"
|
||||||
"./tests/data/kitchen-sink.graphql.golden"
|
<$> getDataFileName "tests/data/kitchen-sink.graphql.graphql.golden"
|
||||||
(parse "./tests/data/kitchen-sink.graphql")
|
<*> (parse <$> getDataFileName "tests/data/kitchen-sink.graphql")
|
||||||
where
|
where
|
||||||
parse = fmap (parseOnly document) . TIO.readFile
|
parse = fmap (parseOnly document) . TIO.readFile
|
||||||
>=> pure . either B8.pack (flip B8.snoc '\n' . B8.pack . show)
|
>=> pure . either B8.pack (flip B8.snoc '\n' . B8.pack . show)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user