diff options
| author | Danny Navarro <j@dannynavarro.net> | 2015-10-19 12:19:39 +0200 |
|---|---|---|
| committer | Danny Navarro <j@dannynavarro.net> | 2015-10-19 12:19:39 +0200 |
| commit | 4e5dc3433a53c2e0404fd2adb9fb33c898d1afa6 (patch) | |
| tree | bb58db83119bb0152a0df5ef76d4ebd6baa151c7 /tests/tasty.hs | |
| parent | 3f30a44d1d9464ec112246c7dae1a5519b39769e (diff) | |
| download | graphql-4e5dc3433a53c2e0404fd2adb9fb33c898d1afa6.tar.gz | |
Implement first StarWars end-to-end test
`execute` still needs to be implemented.
Diffstat (limited to 'tests/tasty.hs')
| -rw-r--r-- | tests/tasty.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/tasty.hs b/tests/tasty.hs index a034a79..1dd9466 100644 --- a/tests/tasty.hs +++ b/tests/tasty.hs @@ -8,16 +8,20 @@ import Control.Applicative ((<$>), (<*>)) import Data.Attoparsec.Text (parseOnly) import qualified Data.Text.IO as Text -import Test.Tasty (defaultMain) +import Test.Tasty (TestTree, defaultMain, testGroup) import Test.Tasty.HUnit import qualified Data.GraphQL.Parser as Parser import qualified Data.GraphQL.Encoder as Encoder +import qualified Test.StarWars as SW import Paths_graphql (getDataFileName) main :: IO () -main = defaultMain =<< testCase "Kitchen Sink" +main = defaultMain . testGroup "Tests" . (: [SW.test]) =<< ksTest + +ksTest :: IO TestTree +ksTest = testCase "Kitchen Sink" <$> (assertEqual "Encode" <$> expected <*> actual) where expected = Text.readFile @@ -26,3 +30,4 @@ main = defaultMain =<< testCase "Kitchen Sink" actual = either (error "Parsing error!") Encoder.document <$> parseOnly Parser.document <$> expected + |
