Add compaction tests for @list with @annotation
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Wed, 19 Dec 2012 20:19:46 +0100
changeset 1067 65f6f9a00739
parent 1066 b88a5aaa4f44
child 1068 721b31f972ba
Add compaction tests for @list with @annotation
test-suite/tests/compact-0041-context.jsonld
test-suite/tests/compact-0041-in.jsonld
test-suite/tests/compact-0041-out.jsonld
test-suite/tests/compact-0042-context.jsonld
test-suite/tests/compact-0042-in.jsonld
test-suite/tests/compact-0042-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0041-context.jsonld	Wed Dec 19 20:19:46 2012 +0100
@@ -0,0 +1,5 @@
+{
+   "@context": {
+      "name": { "@id": "http://example.com/property", "@container": "@list" }
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0041-in.jsonld	Wed Dec 19 20:19:46 2012 +0100
@@ -0,0 +1,15 @@
+[
+    {
+      "@id": "http://example.com/node",
+      "http://example.com/property": [
+          {
+            "@annotation": "an annotation",
+            "@list": [
+                {
+                  "@value": "one item"
+                }
+            ]
+          }
+      ]
+    }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0041-out.jsonld	Wed Dec 19 20:19:46 2012 +0100
@@ -0,0 +1,12 @@
+{
+   "@context": {
+      "name": { "@id": "http://example.com/property", "@container": "@list" }
+   },
+   "@id": "http://example.com/node",
+   "http://example.com/property": {
+      "@list": [
+        "one item"
+      ],
+      "@annotation": "an annotation"
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0042-context.jsonld	Wed Dec 19 20:19:46 2012 +0100
@@ -0,0 +1,6 @@
+{
+   "@context": {
+      "listAlias": "@list",
+      "annotationAlias": "@annotation"
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0042-in.jsonld	Wed Dec 19 20:19:46 2012 +0100
@@ -0,0 +1,15 @@
+[
+   {
+    "@id": "http://example.com/node",
+    "http://example.com/property": [
+       {
+        "@list": [
+           {
+            "@value": "one item"
+           }
+        ],
+        "@annotation": "an annotation"
+       }
+    ]
+   }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0042-out.jsonld	Wed Dec 19 20:19:46 2012 +0100
@@ -0,0 +1,13 @@
+{
+    "@context": {
+       "listAlias": "@list",
+       "annotationAlias": "@annotation"
+    },
+    "@id": "http://example.com/node",
+    "http://example.com/property": {
+        "listAlias": [
+            "one item"
+        ],
+        "annotationAlias": "an annotation"
+    }
+}
--- a/test-suite/tests/compact-manifest.jsonld	Wed Dec 19 18:56:32 2012 +0100
+++ b/test-suite/tests/compact-manifest.jsonld	Wed Dec 19 20:19:46 2012 +0100
@@ -246,5 +246,17 @@
     "input": "compact-0040-in.jsonld",
     "context": "compact-0040-context.jsonld",
     "expect": "compact-0040-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "If an annotation is present, a term having an @list container is not selected",
+    "input": "compact-0041-in.jsonld",
+    "context": "compact-0041-context.jsonld",
+    "expect": "compact-0041-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "Make sure keyword aliasing works if a list can't be compacted",
+    "input": "compact-0042-in.jsonld",
+    "context": "compact-0042-context.jsonld",
+    "expect": "compact-0042-out.jsonld"
   }]
 }