Add context reset test
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Sun, 01 Apr 2012 21:10:34 +0800
changeset 447 0b852c7d1186
parent 446 ac879566d928
child 448 db9bd6eaf6be
Add context reset test
test-suite/tests/expand-0016-in.jsonld
test-suite/tests/expand-0016-out.jsonld
test-suite/tests/expand-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0016-in.jsonld	Sun Apr 01 21:10:34 2012 +0800
@@ -0,0 +1,30 @@
+{
+  "@context": {
+    "myproperty": { "@id": "http://example.com/myproperty" },
+    "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/id1",
+  "mylist1": [],
+  "mylist2": [ { "@set": [] }, [], { "@set": [ 2, "hi" ] } ],
+  "myset1": { "@set": [] },
+  "myset2": [ { "@set": [] }, [], { "@set": [ null ] }, [ null ] ],
+  "myproperty": {
+    "@context": null,
+    "@id": "http://example.org/id2",
+    "mylist1": [],
+    "mylist2": [ { "@set": [] }, [], { "@set": [ 2, "hi" ] } ],
+    "myset1": { "@set": [] },
+    "myset2": [ { "@set": [] }, [], { "@set": [ null ] }, [ null ] ],
+    "http://example.org/myproperty2": "ok"
+  },
+  "http://example.com/emptyobj": {
+    "@context": null,
+    "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-0016-out.jsonld	Sun Apr 01 21:10:34 2012 +0800
@@ -0,0 +1,16 @@
+[
+  {
+    "@id": "http://example.org/id1",
+    "http://example.com/mylist1": { "@list": [] },
+    "http://example.com/mylist2": { "@list": [ [] , [], [ 2, "hi" ] ] },
+    "http://example.com/myset1": [ ],
+    "http://example.com/myset2": [ ],
+    "http://example.com/myproperty": [
+      {
+        "@id": "http://example.org/id2",
+        "http://example.org/myproperty2": [ "ok" ]
+      }
+    ],
+    "http://example.com/emptyobj": [ { } ]
+  }
+]
--- a/test-suite/tests/expand-manifest.jsonld	Sun Apr 01 19:59:06 2012 +0800
+++ b/test-suite/tests/expand-manifest.jsonld	Sun Apr 01 21:10:34 2012 +0800
@@ -79,5 +79,10 @@
     "name": "keep lists of sets (also empty ones), optimize set of sets",
     "input": "expand-0015-in.jsonld",
     "expect": "expand-0015-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:ExpandTest"],
+    "name": "context reset",
+    "input": "expand-0016-in.jsonld",
+    "expect": "expand-0016-out.jsonld"
   }]
 }