diff options
Diffstat (limited to 'test/Spec.hs')
-rw-r--r-- | test/Spec.hs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/test/Spec.hs b/test/Spec.hs index c58bbfa..c85ac53 100644 --- a/test/Spec.hs +++ b/test/Spec.hs | |||
@@ -1,24 +1,31 @@ | |||
1 | import Data.JLD.Prelude | 1 | import Data.JLD.Prelude |
2 | 2 | ||
3 | import Data.JLD.Mime (mimeType) | ||
4 | import Test.Expansion (W3CExpansionTestList, expansionTests) | ||
5 | |||
6 | import Test.Tasty | 3 | import Test.Tasty |
7 | 4 | ||
5 | import Data.JLD.Mime (mimeType) | ||
6 | import Test.Common (W3CTestList) | ||
7 | import Test.Expansion (expansionTests) | ||
8 | import Test.Flattening (flatteningTests) | ||
9 | |||
8 | import Network.HTTP.Req (GET (..), NoReqBody (..), defaultHttpConfig, header, https, jsonResponse, req, responseBody, runReq, (/:)) | 10 | import Network.HTTP.Req (GET (..), NoReqBody (..), defaultHttpConfig, header, https, jsonResponse, req, responseBody, runReq, (/:)) |
9 | 11 | ||
10 | tests :: W3CExpansionTestList -> TestTree | 12 | tests :: W3CTestList -> W3CTestList -> TestTree |
11 | tests jldExpansionTestList = | 13 | tests expansionTestList flatteningTestList = |
12 | testGroup | 14 | testGroup |
13 | "Tests" | 15 | "Tests" |
14 | [ expansionTests jldExpansionTestList | 16 | [ expansionTests expansionTestList |
17 | , flatteningTests flatteningTestList | ||
15 | ] | 18 | ] |
16 | 19 | ||
17 | main :: IO () | 20 | main :: IO () |
18 | main = do | 21 | main = do |
19 | jldExpansionTestList <- runReq defaultHttpConfig do | 22 | expansionTestList <- runReq defaultHttpConfig do |
20 | responseBody <$> req GET w3cExpansionTestListUrl NoReqBody jsonResponse (header "Accept" mimeType) | 23 | responseBody <$> req GET w3cExpansionTestListUrl NoReqBody jsonResponse (header "Accept" mimeType) |
21 | 24 | ||
22 | defaultMain <| tests jldExpansionTestList | 25 | flatteningTestList <- runReq defaultHttpConfig do |
26 | responseBody <$> req GET w3cFlatteningTestListUrl NoReqBody jsonResponse (header "Accept" mimeType) | ||
27 | |||
28 | defaultMain <| tests expansionTestList flatteningTestList | ||
23 | where | 29 | where |
24 | w3cExpansionTestListUrl = https "w3c.github.io" /: "json-ld-api" /: "tests" /: "expand-manifest.jsonld" | 30 | w3cExpansionTestListUrl = https "w3c.github.io" /: "json-ld-api" /: "tests" /: "expand-manifest.jsonld" |
31 | w3cFlatteningTestListUrl = https "w3c.github.io" /: "json-ld-api" /: "tests" /: "flatten-manifest.jsonld" | ||