Test that empty arrays of property generators round trip in compaction
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Thu, 20 Dec 2012 19:21:06 +0100
changeset 1073 dcb6098bacd9
parent 1072 72220e35186f
child 1074 d254bb5a2218
Test that empty arrays of property generators round trip in compaction
test-suite/tests/compact-0044-context.jsonld
test-suite/tests/compact-0044-in.jsonld
test-suite/tests/compact-0044-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0044-context.jsonld	Thu Dec 20 19:21:06 2012 +0100
@@ -0,0 +1,11 @@
+{
+  "@context": {
+    "prop": "http://example.com/prop/",
+    "propGen": {
+      "@id": [ "prop:1", "prop:2", "prop:3" ]
+    },
+    "propGenMismatch": {
+      "@id": [ "prop:4", "prop:5", "prop:6" ]
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0044-in.jsonld	Thu Dec 20 19:21:06 2012 +0100
@@ -0,0 +1,9 @@
+[
+  {
+    "http://example.com/prop/1": [],
+    "http://example.com/prop/2": [],
+    "http://example.com/prop/3": [],
+    "http://example.com/prop/4": [],
+    "http://example.com/prop/5": []
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0044-out.jsonld	Thu Dec 20 19:21:06 2012 +0100
@@ -0,0 +1,14 @@
+{
+  "@context": {
+    "prop": "http://example.com/prop/",
+    "propGen": {
+      "@id": [ "prop:1", "prop:2", "prop:3" ]
+    },
+    "propGenMismatch": {
+      "@id": [ "prop:4", "prop:5", "prop:6" ]
+    }
+  },
+  "propGen": [],
+  "prop:4": [],
+  "prop:5": []
+}
--- a/test-suite/tests/compact-manifest.jsonld	Thu Dec 20 18:44:58 2012 +0100
+++ b/test-suite/tests/compact-manifest.jsonld	Thu Dec 20 19:21:06 2012 +0100
@@ -265,6 +265,12 @@
       "input": "compact-0043-in.jsonld",
       "context": "compact-0043-context.jsonld",
       "expect": "compact-0043-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:CompactTest"],
+      "name": "Keep empty arrays in property generators",
+      "input": "compact-0044-in.jsonld",
+      "context": "compact-0044-context.jsonld",
+      "expect": "compact-0044-out.jsonld"
     }
   ]
 }