Add compaction test for mixed lists
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Sat, 08 Dec 2012 19:06:45 +0100
changeset 1005 447afde5fea8
parent 1004 f98a8c4e8350
child 1006 ad2b67d9c653
Add compaction test for mixed lists

This addresses #172.
test-suite/tests/compact-0024-context.jsonld
test-suite/tests/compact-0024-in.jsonld
test-suite/tests/compact-0024-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0024-context.jsonld	Sat Dec 08 19:06:45 2012 +0100
@@ -0,0 +1,16 @@
+{
+  "@context": {
+    "id1": "http://example.com/id1",
+    "type1": "http://example.com/t1",
+    "type2": "http://example.com/t2",
+    "@language": "de",
+    "termL": { "@id": "http://example.com/termLanguage" },
+    "termLL0": { "@id": "http://example.com/termLanguage", "@container": "@list" },
+    "termLL1": { "@id": "http://example.com/termLanguage", "@container": "@list", "@language": "en" },
+    "termLL2": { "@id": "http://example.com/termLanguage", "@container": "@list", "@language": null },
+    "termT": { "@id": "http://example.com/termType" },
+    "termTL0": { "@id": "http://example.com/termType", "@container": "@list" },
+    "termTL1": { "@id": "http://example.com/termType", "@container": "@list", "@type": "type1" },
+    "termTL2": { "@id": "http://example.com/termType", "@container": "@list", "@type": "type2" }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0024-in.jsonld	Sat Dec 08 19:06:45 2012 +0100
@@ -0,0 +1,48 @@
+{
+
+  "@context": {
+    "type1": "http://example.com/t1",
+    "type2": "http://example.com/t2"
+  },
+  "@id": "http://example.com/id1",
+  "http://example.com/termLanguage": [
+    {
+      "@list": [
+        { "@value": "termLL0.1", "@language": "de" },
+        { "@value": "termLL0.2", "@language": "de" }
+      ]
+    },
+    {
+      "@list": [
+        { "@value": "termLL1.1", "@language": "en" },
+        { "@value": "termLL1.2", "@language": "en" }
+      ]
+    },
+    {
+      "@list": [
+        "termLL2.1",
+        "termLL2.2"
+      ]
+    }
+  ],
+  "http://example.com/termType": [
+    {
+      "@list": [
+        { "@value": "termTL0.1", "@type": "type1" },
+        { "@value": "termTL0.2", "@type": "type2" }
+      ]
+    },
+    {
+      "@list": [
+        { "@value": "termTL1.1", "@type": "type1" },
+        { "@value": "termTL1.2", "@type": "type1" }
+      ]
+    },
+    {
+      "@list": [
+        { "@value": "termTL2.1", "@type": "type2" },
+        { "@value": "termTL2.2", "@type": "type2" }
+      ]
+    }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0024-out.jsonld	Sat Dec 08 19:06:45 2012 +0100
@@ -0,0 +1,47 @@
+{
+  "@context": {
+    "id1": "http://example.com/id1",
+    "type1": "http://example.com/t1",
+    "type2": "http://example.com/t2",
+    "@language": "de",
+    "termL": { "@id": "http://example.com/termLanguage" },
+    "termLL0": { "@id": "http://example.com/termLanguage", "@container": "@list" },
+    "termLL1": { "@id": "http://example.com/termLanguage", "@container": "@list", "@language": "en" },
+    "termLL2": { "@id": "http://example.com/termLanguage", "@container": "@list", "@language": null },
+    "termT": { "@id": "http://example.com/termType" },
+    "termTL0": { "@id": "http://example.com/termType", "@container": "@list" },
+    "termTL1": { "@id": "http://example.com/termType", "@container": "@list", "@type": "type1" },
+    "termTL2": { "@id": "http://example.com/termType", "@container": "@list", "@type": "type2" }
+  },
+  "@id": "id1",
+  "termLL0": [
+    "termLL0.1",
+    "termLL0.2"
+  ],
+  "termLL1": [
+    "termLL1.1",
+    "termLL1.2"
+  ],
+  "termLL2": [
+    "termLL2.1",
+    "termLL2.2"
+  ],
+  "termTL0": [
+    {
+      "@type": "type1",
+      "@value": "termTL0.1"
+    },
+    {
+      "@type": "type2",
+      "@value": "termTL0.2"
+    }
+  ],
+  "termTL1": [
+    "termTL1.1",
+    "termTL1.2"
+  ],
+  "termTL2": [
+    "termTL2.1",
+    "termTL2.2"
+  ]
+}
--- a/test-suite/tests/compact-manifest.jsonld	Sat Dec 08 17:00:14 2012 +0100
+++ b/test-suite/tests/compact-manifest.jsonld	Sat Dec 08 19:06:45 2012 +0100
@@ -144,5 +144,11 @@
     "input": "compact-0023-in.jsonld",
     "context": "compact-0023-context.jsonld",
     "expect": "compact-0023-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "The most specific term that matches all of the elements in the list, taking into account the default language, must be selected.",
+    "input": "compact-0024-in.jsonld",
+    "context": "compact-0024-context.jsonld",
+    "expect": "compact-0024-out.jsonld"
   }]
 }