Add test for removing non-uniques from @set, preserving in @list.
authorDave Longley <dlongley@digitalbazaar.com>
Mon, 21 May 2012 18:10:42 -0400
changeset 666 996923b81826
parent 665 3595fa871cbc
child 667 558e03e1c0df
Add test for removing non-uniques from @set, preserving in @list.
test-suite/tests/expand-0027-in.jsonld
test-suite/tests/expand-0027-out.jsonld
test-suite/tests/expand-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0027-in.jsonld	Mon May 21 18:10:42 2012 -0400
@@ -0,0 +1,9 @@
+{
+  "@context": {
+    "mylist": {"@id": "http://example.com/mylist", "@container": "@list"},
+    "myset": {"@id": "http://example.com/myset", "@container": "@set"}
+  },
+  "@id": "http://example.org/id",
+  "mylist": [1, 2, 2, 3],
+  "myset": [1, 2, 2, 3]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0027-out.jsonld	Mon May 21 18:10:42 2012 -0400
@@ -0,0 +1,16 @@
+[{
+  "@id": "http://example.org/id",
+  "http://example.com/mylist": [{
+    "@list": [
+      {"@value": 1},
+      {"@value": 2},
+      {"@value": 2},
+      {"@value": 3}
+    ]
+  }],
+  "http://example.com/myset": [
+    {"@value": 1},
+    {"@value": 2},
+    {"@value": 3}
+  ]
+}]
--- a/test-suite/tests/expand-manifest.jsonld	Mon May 21 17:42:13 2012 -0400
+++ b/test-suite/tests/expand-manifest.jsonld	Mon May 21 18:10:42 2012 -0400
@@ -134,5 +134,10 @@
     "name": "Expanding term mapping to @type uses @type syntax",
     "input": "expand-0026-in.jsonld",
     "expect": "expand-0026-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:ExpandTest"],
+    "name": "Keep duplicate values in @list, remove from @set",
+    "input": "expand-0027-in.jsonld",
+    "expect": "expand-0027-out.jsonld"
   }]
 }