Add simple language map compaction test
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Sat, 08 Dec 2012 21:31:19 +0100
changeset 1007 51112e97499e
parent 1006 ad2b67d9c653
child 1008 f2529feda03b
Add simple language map compaction test

This addresses #133.
test-suite/tests/compact-0025-context.jsonld
test-suite/tests/compact-0025-in.jsonld
test-suite/tests/compact-0025-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0025-context.jsonld	Sat Dec 08 21:31:19 2012 +0100
@@ -0,0 +1,9 @@
+{
+  "@context": {
+    "vocab": "http://example.com/vocab/",
+    "label": {
+      "@id": "vocab:label",
+      "@container": "@language"
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0025-in.jsonld	Sat Dec 08 21:31:19 2012 +0100
@@ -0,0 +1,18 @@
+[
+  {
+    "@id": "http://example.com/queen",
+    "http://example.com/vocab/label":
+    [
+      {
+        "@value": "The Queen",
+        "@language": "en"
+      }, {
+        "@value": "Die Königin",
+        "@language": "de"
+      }, {
+        "@value": "Ihre Majestät",
+        "@language": "de"
+      }
+    ]
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0025-out.jsonld	Sat Dec 08 21:31:19 2012 +0100
@@ -0,0 +1,14 @@
+{
+  "@context": {
+    "vocab": "http://example.com/vocab/",
+    "label": {
+      "@id": "vocab:label",
+      "@container": "@language"
+    }
+  },
+  "@id": "http://example.com/queen",
+  "label": {
+    "en": "The Queen",
+    "de": [ "Die Königin", "Ihre Majestät" ]
+  }
+}
--- a/test-suite/tests/compact-manifest.jsonld	Sat Dec 08 21:03:19 2012 +0100
+++ b/test-suite/tests/compact-manifest.jsonld	Sat Dec 08 21:31:19 2012 +0100
@@ -150,5 +150,11 @@
     "input": "compact-0024-in.jsonld",
     "context": "compact-0024-context.jsonld",
     "expect": "compact-0024-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "Language maps",
+    "input": "compact-0025-in.jsonld",
+    "context": "compact-0025-context.jsonld",
+    "expect": "compact-0025-out.jsonld"
   }]
 }