Add test for sets of lists and sets of sets
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Sun, 01 Apr 2012 00:44:23 +0800
changeset 443 1b367646edd9
parent 442 398e23d00902
child 444 335f4e626911
Add test for sets of lists and sets of sets
test-suite/tests/expand-0015-in.jsonld
test-suite/tests/expand-0015-out.jsonld
test-suite/tests/expand-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0015-in.jsonld	Sun Apr 01 00:44:23 2012 +0800
@@ -0,0 +1,13 @@
+{
+  "@context": {
+    "mylist1": {"@id": "http://example.com/mylist1", "@container": "@list"},
+    "mylist2": {"@id": "http://example.com/mylist2", "@container": "@list"},
+    "myset1": {"@id": "http://example.com/myset1", "@container": "@set" },
+    "myset2": {"@id": "http://example.com/myset2", "@container": "@set" }
+  },
+  "@id": "http://example.org/id",
+  "mylist1": [],
+  "mylist2": [ { "@set": [] }, [], { "@set": [ 2, "hi" ] } ],
+  "myset1": { "@set": [] },
+  "myset2": [ { "@set": [] }, [], { "@set": [ null ] }, [ null ] ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0015-out.jsonld	Sun Apr 01 00:44:23 2012 +0800
@@ -0,0 +1,9 @@
+[
+  {
+    "@id": "http://example.org/id",
+    "http://example.com/mylist1": { "@list": [] },
+    "http://example.com/mylist2": { "@list": [ [] , [], [ 2, "hi" ] ] },
+    "http://example.com/myset1": [],
+    "http://example.com/myset2": [ ]
+  }
+]
--- a/test-suite/tests/expand-manifest.jsonld	Sat Mar 31 17:16:48 2012 +0800
+++ b/test-suite/tests/expand-manifest.jsonld	Sun Apr 01 00:44:23 2012 +0800
@@ -74,5 +74,10 @@
     "name": "@set of @value objects with keyword aliases",
     "input": "expand-0014-in.jsonld",
     "expect": "expand-0014-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:ExpandTest"],
+    "name": "keep lists of sets (also empty ones), optimize set of sets",
+    "input": "expand-0015-in.jsonld",
+    "expect": "expand-0015-out.jsonld"
   }]
 }