Add language-map expansion test
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Wed, 19 Sep 2012 19:11:50 +0200
changeset 868 d07428269ace
parent 867 72f6b506265f
child 869 906337968c02
Add language-map expansion test

This test assumes that the language is injected as the default language into the active context. Depending on the outcome of issue #159 this test might need to be updated.

This addresses #133.
test-suite/tests/expand-0030-in.jsonld
test-suite/tests/expand-0030-out.jsonld
test-suite/tests/expand-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0030-in.jsonld	Wed Sep 19 19:11:50 2012 +0200
@@ -0,0 +1,21 @@
+{
+  "@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" ],
+    "xx": {
+      "@context": {
+        "prop": "vocab:aPropertyJustToTestIfDefaultLangIsInjected"
+      },
+      "@id": "http://example.com/nested",
+      "prop": "This is a string tagged with the language xx"
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0030-out.jsonld	Wed Sep 19 19:11:50 2012 +0200
@@ -0,0 +1,27 @@
+[
+  {
+    "@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"
+      }, {
+        "@id": "http://example.com/nested",
+        "http://example.com/vocab/aPropertyJustToTestIfDefaultLangIsInjected":
+        [
+          {
+            "@value": "This is a string tagged with the language xx",
+            "@language": "xx"
+          }
+        ]
+      }
+    ]
+  }
+]
--- a/test-suite/tests/expand-manifest.jsonld	Wed Sep 19 18:07:29 2012 +0200
+++ b/test-suite/tests/expand-manifest.jsonld	Wed Sep 19 19:11:50 2012 +0200
@@ -151,6 +151,11 @@
       "name": "Relative IRIs",
       "input": "expand-0029-in.jsonld",
       "expect": "expand-0029-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:ExpandTest"],
+      "name": "Language maps",
+      "input": "expand-0030-in.jsonld",
+      "expect": "expand-0030-out.jsonld"
     }
   ]
 }