Add test for multiple properties expanding to the same IRI
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Mon, 03 Dec 2012 19:31:01 +0100
changeset 977 d56b0ea95dbf
parent 976 ce61dfa00d1e
child 978 a098d9cd2b0c
Add test for multiple properties expanding to the same IRI

In case anyone wonders why "5" is at the beginning of the array after expansion that's because my implementation works that way and I was too lazy to update my test suite to ignore array order.
test-suite/tests/expand-0034-in.jsonld
test-suite/tests/expand-0034-out.jsonld
test-suite/tests/expand-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0034-in.jsonld	Mon Dec 03 19:31:01 2012 +0100
@@ -0,0 +1,16 @@
+{
+  "@context": {
+    "@vocab": "http://example.com/vocab/",
+    "colliding": "http://example.com/vocab/collidingTerm"
+  },
+  "@id": "http://example.com/IriCollissions",
+  "collidingTerm": [
+    "value 1",
+    2
+  ],
+  "colliding": [
+    3,
+    "four"
+  ],
+  "http://example.com/vocab/collidingTerm": 5
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0034-out.jsonld	Mon Dec 03 19:31:01 2012 +0100
@@ -0,0 +1,16 @@
+[{
+   "@id": "http://example.com/IriCollissions",
+   "http://example.com/vocab/collidingTerm": [
+      {
+         "@value": 5
+      }, {
+         "@value": "value 1"
+      }, {
+         "@value": 2
+      }, {
+         "@value": 3
+      }, {
+         "@value": "four"
+      }
+   ]
+}]
--- a/test-suite/tests/expand-manifest.jsonld	Mon Dec 03 18:52:01 2012 +0100
+++ b/test-suite/tests/expand-manifest.jsonld	Mon Dec 03 19:31:01 2012 +0100
@@ -171,6 +171,11 @@
       "name": "Using @vocab with with type-coercion",
       "input": "expand-0033-in.jsonld",
       "expect": "expand-0033-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:ExpandTest"],
+      "name": "Multiple properties expanding to the same IRI",
+      "input": "expand-0034-in.jsonld",
+      "expect": "expand-0034-out.jsonld"
     }
   ]
 }