aboutsummaryrefslogtreecommitdiffstats
path: root/test/Spec.hs
diff options
context:
space:
mode:
authorVolpeon <github@volpeon.ink>2023-05-28 08:13:08 +0200
committerVolpeon <github@volpeon.ink>2023-05-28 08:13:08 +0200
commit8c49a30faa431b8b56a4b4926e7dae56b1311fea (patch)
tree6a103b49cdfe6df38fadad1f9d59521dd92ebf74 /test/Spec.hs
parentAdded Node Map Merging algorithm (diff)
downloadhs-jsonld-8c49a30faa431b8b56a4b4926e7dae56b1311fea.tar.gz
hs-jsonld-8c49a30faa431b8b56a4b4926e7dae56b1311fea.tar.bz2
hs-jsonld-8c49a30faa431b8b56a4b4926e7dae56b1311fea.zip
Completed untested Flattening implementation
Diffstat (limited to 'test/Spec.hs')
-rw-r--r--test/Spec.hs23
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 @@
1import Data.JLD.Prelude 1import Data.JLD.Prelude
2 2
3import Data.JLD.Mime (mimeType)
4import Test.Expansion (W3CExpansionTestList, expansionTests)
5
6import Test.Tasty 3import Test.Tasty
7 4
5import Data.JLD.Mime (mimeType)
6import Test.Common (W3CTestList)
7import Test.Expansion (expansionTests)
8import Test.Flattening (flatteningTests)
9
8import Network.HTTP.Req (GET (..), NoReqBody (..), defaultHttpConfig, header, https, jsonResponse, req, responseBody, runReq, (/:)) 10import Network.HTTP.Req (GET (..), NoReqBody (..), defaultHttpConfig, header, https, jsonResponse, req, responseBody, runReq, (/:))
9 11
10tests :: W3CExpansionTestList -> TestTree 12tests :: W3CTestList -> W3CTestList -> TestTree
11tests jldExpansionTestList = 13tests expansionTestList flatteningTestList =
12 testGroup 14 testGroup
13 "Tests" 15 "Tests"
14 [ expansionTests jldExpansionTestList 16 [ expansionTests expansionTestList
17 , flatteningTests flatteningTestList
15 ] 18 ]
16 19
17main :: IO () 20main :: IO ()
18main = do 21main = 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"