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