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