Add tests for index-maps/language-maps
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Mon, 18 Feb 2013 15:47:09 +0100
changeset 1299 ff8ffa55b5e3
parent 1298 c7483c370274
child 1300 6cbbbe3b892b
Add tests for index-maps/language-maps

This illustrates a bug in the current algorithms. See also #218.
test-suite/tests/compact-0064-context.jsonld
test-suite/tests/compact-0064-in.jsonld
test-suite/tests/compact-0064-out.jsonld
test-suite/tests/compact-0065-context.jsonld
test-suite/tests/compact-0065-in.jsonld
test-suite/tests/compact-0065-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0064-context.jsonld	Mon Feb 18 15:47:09 2013 +0100
@@ -0,0 +1,5 @@
+{
+  "@context": {
+    "property": { "@id": "http://example.com/property", "@container": "@index" }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0064-in.jsonld	Mon Feb 18 15:47:09 2013 +0100
@@ -0,0 +1,17 @@
+[
+    {
+      "@id": "http://example.com.com/",
+      "http://example.com/property": [
+          {
+            "@value": "Deutsche Zeichenfolge in @index-map",
+            "@index": "first",
+            "@language": "de"
+          },
+          {
+            "@value": "English string in @index-map",
+            "@index": "second",
+            "@language": "en"
+          }
+      ]
+    }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0064-out.jsonld	Mon Feb 18 15:47:09 2013 +0100
@@ -0,0 +1,16 @@
+{
+  "@context": {
+    "property": { "@id": "http://example.com/property", "@container": "@index" }
+  },
+  "@id": "http://example.com.com/",
+  "property": {
+    "first": {
+      "@language": "de",
+      "@value": "Deutsche Zeichenfolge in @index-map"
+    },
+    "second": {
+      "@language": "en",
+      "@value": "English string in @index-map"
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0065-context.jsonld	Mon Feb 18 15:47:09 2013 +0100
@@ -0,0 +1,5 @@
+{
+  "@context": {
+    "property": { "@id": "http://example.com/property", "@container": "@language" }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0065-in.jsonld	Mon Feb 18 15:47:09 2013 +0100
@@ -0,0 +1,17 @@
+[
+    {
+      "@id": "http://example.com.com/",
+      "http://example.com/property": [
+          {
+            "@value": "Deutsche Zeichenfolge in @index-map",
+            "@index": "first",
+            "@language": "de"
+          },
+          {
+            "@value": "English string in @index-map",
+            "@index": "second",
+            "@language": "en"
+          }
+      ]
+    }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0065-out.jsonld	Mon Feb 18 15:47:09 2013 +0100
@@ -0,0 +1,18 @@
+{
+  "@context": {
+    "property": { "@id": "http://example.com/property", "@container": "@language" }
+  },
+  "@id": "http://example.com.com/",
+  "http://example.com/property": [
+    {
+      "@index": "first",
+      "@language": "de",
+      "@value": "Deutsche Zeichenfolge in @index-map"
+    },
+    {
+      "@index": "second",
+      "@language": "en",
+      "@value": "English string in @index-map"
+    }
+  ]
+}
--- a/test-suite/tests/compact-manifest.jsonld	Mon Feb 18 15:44:20 2013 +0100
+++ b/test-suite/tests/compact-manifest.jsonld	Mon Feb 18 15:47:09 2013 +0100
@@ -384,6 +384,18 @@
       "input": "compact-0063-in.jsonld",
       "context": "compact-0063-context.jsonld",
       "expect": "compact-0063-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:CompactTest"],
+      "name": "Compact language-tagged and indexed strings to index-map",
+      "input": "compact-0064-in.jsonld",
+      "context": "compact-0064-context.jsonld",
+      "expect": "compact-0064-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:CompactTest"],
+      "name": "Language-tagged and indexed strings don't compact to language-map",
+      "input": "compact-0065-in.jsonld",
+      "context": "compact-0065-context.jsonld",
+      "expect": "compact-0065-out.jsonld"
     }
   ]
 }