Add complex test for list compaction
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Thu, 03 May 2012 20:51:13 +0800
changeset 615 431b7936e575
parent 614 5259a1abcf03
child 616 bc7ec7b11f03
Add complex test for list compaction
test-suite/tests/compact-0018-context.jsonld
test-suite/tests/compact-0018-in.jsonld
test-suite/tests/compact-0018-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0018-context.jsonld	Thu May 03 20:51:13 2012 +0800
@@ -0,0 +1,14 @@
+{
+  "@context": {
+    "id1": "http://example.com/id1",
+    "type1": "http://example.com/t1",
+    "type2": "http://example.com/t2",
+    "@language": "de",
+    "term": { "@id": "http://example.com/term" },
+    "term1": { "@id": "http://example.com/term", "@container": "@list" },
+    "term2": { "@id": "http://example.com/term", "@container": "@list", "@language": "en" },
+    "term3": { "@id": "http://example.com/term", "@container": "@list", "@language": null },
+    "term4": { "@id": "http://example.com/term", "@container": "@list", "@type": "type1" },
+    "term5": { "@id": "http://example.com/term", "@container": "@list", "@type": "type2" }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0018-in.jsonld	Thu May 03 20:51:13 2012 +0800
@@ -0,0 +1,59 @@
+{
+  "@context": {
+    "type1": "http://example.com/t1",
+    "type2": "http://example.com/t2"
+  },
+  "@id": "http://example.com/id1",
+  "http://example.com/term": [
+    {
+      "@list": [
+        { "@value": "v1.1", "@language": "de" },
+        { "@value": "v1.2", "@language": "de" },
+        { "@value": "v1.3", "@language": "de" },
+        4,
+        { "@value": "v1.5", "@language": "en" },
+        { "@value": "v1.6", "@language": "en" }
+      ]
+    },
+    {
+      "@list": [
+        { "@value": "v2.1", "@language": "en" },
+        { "@value": "v2.2", "@language": "en" },
+        { "@value": "v2.3", "@language": "en" },
+        4,
+        { "@value": "v2.5", "@language": "de" },
+        { "@value": "v2.6", "@language": "de" }
+      ]
+    },
+    {
+      "@list": [
+        { "@value": "v3.1", "@language": null },
+        { "@value": "v3.2", "@language": null },
+        "v3.3",
+        4,
+        { "@value": "v3.5", "@language": "en" },
+        { "@value": "v3.6", "@language": "en" }
+      ]
+    },
+    {
+      "@list": [
+        { "@value": "v4.1", "@type": "type1" },
+        { "@value": "v4.2", "@type": "type1" },
+        { "@value": "v4.3", "@type": "type1" },
+        { "@value": "v4.4", "@type": "type1" },
+        { "@value": "v4.5", "@language": "de" },
+        { "@value": "v4.6", "@language": "en" }
+      ]
+    },
+    {
+      "@list": [
+        { "@value": "v5.1", "@type": "type2" },
+        { "@value": "v5.2", "@type": "type2" },
+        { "@value": "v5.3", "@type": "type2" },
+        4,
+        { "@value": "v5.5", "@type": "type2" },
+        "v5.6"
+      ]
+    }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0018-out.jsonld	Thu May 03 20:51:13 2012 +0800
@@ -0,0 +1,55 @@
+{
+  "@context": {
+    "id1": "http://example.com/id1",
+    "type1": "http://example.com/t1",
+    "type2": "http://example.com/t2",
+    "@language": "de",
+    "term": { "@id": "http://example.com/term" },
+    "term1": { "@id": "http://example.com/term", "@container": "@list" },
+    "term2": { "@id": "http://example.com/term", "@container": "@list", "@language": "en" },
+    "term3": { "@id": "http://example.com/term", "@container": "@list", "@language": null },
+    "term4": { "@id": "http://example.com/term", "@container": "@list", "@type": "type1" },
+    "term5": { "@id": "http://example.com/term", "@container": "@list", "@type": "type2" }
+  },
+  "@id": "id1",
+  "term1": [
+    "v1.1",
+    "v1.2",
+    "v1.3",
+    4,
+    { "@value": "v1.5", "@language": "en" },
+    { "@value": "v1.6", "@language": "en" }
+  ],
+  "term2": [
+    "v2.1",
+    "v2.2",
+    "v2.3",
+    4,
+    { "@value": "v2.5", "@language": "de" },
+    { "@value": "v2.6", "@language": "de" }
+  ],
+  "term3": [
+    "v3.1",
+    "v3.2",
+    "v3.3",
+    4,
+    { "@value": "v3.5", "@language": "en" },
+    { "@value": "v3.6", "@language": "en" }
+  ],
+  "term4": [
+    "v4.1",
+    "v4.2",
+    "v4.3",
+    "v4.4",
+    { "@value": "v4.5", "@language": "de" },
+    { "@value": "v4.6", "@language": "en" }
+  ],
+  "term5": [
+    "v5.1",
+    "v5.2",
+    "v5.3",
+    { "@value": 4 },
+    "v5.5",
+    { "@value": "v5.6" }
+  ]
+}
--- a/test-suite/tests/compact-manifest.jsonld	Wed May 02 13:55:45 2012 -0400
+++ b/test-suite/tests/compact-manifest.jsonld	Thu May 03 20:51:13 2012 +0800
@@ -107,5 +107,11 @@
     "input": "compact-0017-in.jsonld",
     "context": "compact-0017-context.jsonld",
     "expect": "compact-0017-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "best matching term for lists",
+    "input": "compact-0018-in.jsonld",
+    "context": "compact-0018-context.jsonld",
+    "expect": "compact-0018-out.jsonld"
   }]
 }