Add error test cases for errors in Context Processing Algorithm.
authorGregg Kellogg <gregg@kellogg-assoc.com>
Sun, 25 Aug 2013 18:00:21 -0700
changeset 1930 ee731e6ac7d1
parent 1929 ce527df44fc4
child 1931 936418842952
Add error test cases for errors in Context Processing Algorithm.
test-suite/tests/error-0002-in.jsonld
test-suite/tests/error-0003-ctx.jsonld
test-suite/tests/error-0003-in.jsonld
test-suite/tests/error-0004-in.jsonld
test-suite/tests/error-0005-in.jsonld
test-suite/tests/error-0006-in.jsonld
test-suite/tests/error-0007-in.jsonld
test-suite/tests/error-0008-in.jsonld
test-suite/tests/error-0009-in.jsonld
test-suite/tests/error-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/error-0002-in.jsonld	Sun Aug 25 18:00:21 2013 -0700
@@ -0,0 +1,4 @@
+{
+  "@context": "error-0002-in.jsonld",
+  "@id": "http://example/test#example"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/error-0003-ctx.jsonld	Sun Aug 25 18:00:21 2013 -0700
@@ -0,0 +1,3 @@
+{
+  "@context": "error-0003-in.jsonld"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/error-0003-in.jsonld	Sun Aug 25 18:00:21 2013 -0700
@@ -0,0 +1,4 @@
+{
+  "@context": "error-0003-ctx.jsonld",
+  "@id": "http://example/test#example"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/error-0004-in.jsonld	Sun Aug 25 18:00:21 2013 -0700
@@ -0,0 +1,4 @@
+{
+  "@context": "tag:non-dereferencable-iri",
+  "@id": "http://example/test#example"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/error-0005-in.jsonld	Sun Aug 25 18:00:21 2013 -0700
@@ -0,0 +1,4 @@
+[{
+  "@context": "error-0005-in.jsonld",
+  "@id": "http://example/test#example"
+}]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/error-0006-in.jsonld	Sun Aug 25 18:00:21 2013 -0700
@@ -0,0 +1,4 @@
+{
+  "@context": true,
+  "@id": "http://example/test#example"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/error-0007-in.jsonld	Sun Aug 25 18:00:21 2013 -0700
@@ -0,0 +1,4 @@
+{
+  "@context": {"@base": true},
+  "@id": "http://example/test#example"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/error-0008-in.jsonld	Sun Aug 25 18:00:21 2013 -0700
@@ -0,0 +1,4 @@
+{
+  "@context": {"@vocab": true},
+  "@id": "http://example/test#example"
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/error-0009-in.jsonld	Sun Aug 25 18:00:21 2013 -0700
@@ -0,0 +1,4 @@
+{
+  "@context": {"@language": true},
+  "@id": "http://example/test#example"
+}
\ No newline at end of file
--- a/test-suite/tests/error-manifest.jsonld	Sun Aug 25 14:48:28 2013 -0700
+++ b/test-suite/tests/error-manifest.jsonld	Sun Aug 25 18:00:21 2013 -0700
@@ -13,6 +13,62 @@
       "purpose": "Verifies that an exception is raised on expansion when processing an invalid context aliasing a keyword to another keyword",
       "input": "error-0001-in.jsonld",
       "expect": "keyword redefinition"
+    }, {
+      "@id": "#t0002",
+      "@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],
+      "name": "A context may not include itself recursively (direct)",
+      "purpose": "Verifies that an exception is raised on expansion when processing a context referencing itself",
+      "input": "error-0002-in.jsonld",
+      "expect": "recursive context inclusion"
+    }, {
+      "@id": "#t0003",
+      "@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],
+      "name": "A context may not include itself recursively (indirect)",
+      "purpose": "Verifies that an exception is raised on expansion when processing a context referencing itself indirectly",
+      "input": "error-0003-in.jsonld",
+      "expect": "recursive context inclusion"
+    }, {
+      "@id": "#t0004",
+      "@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],
+      "name": "Error dereferencing a remote context",
+      "purpose": "Verifies that an exception is raised on expansion when a context dereference results in an error",
+      "input": "error-0004-in.jsonld",
+      "expect": "loading remote context failed"
+    }, {
+      "@id": "#t0005",
+      "@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],
+      "name": "Invalid remote context",
+      "purpose": "Verifies that an exception is raised on expansion when a remote context is not an object containing @context",
+      "input": "error-0005-in.jsonld",
+      "expect": "invalid remote context"
+    }, {
+      "@id": "#t0006",
+      "@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],
+      "name": "Invalid local context",
+      "purpose": "Verifies that an exception is raised on expansion when a context is not a string or object",
+      "input": "error-0006-in.jsonld",
+      "expect": "invalid local context"
+    }, {
+      "@id": "#t0007",
+      "@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],
+      "name": "Invalid base IRI",
+      "purpose": "Verifies that an exception is raised on expansion when a context contains an invalid @base",
+      "input": "error-0007-in.jsonld",
+      "expect": "invalid base IRI"
+    }, {
+      "@id": "#t0008",
+      "@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],
+      "name": "Invalid vocab mapping",
+      "purpose": "Verifies that an exception is raised on expansion when a context contains an invalid @vocab mapping",
+      "input": "error-0008-in.jsonld",
+      "expect": "invalid vocab mapping"
+    }, {
+      "@id": "#t0009",
+      "@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],
+      "name": "Invalid default language",
+      "purpose": "Verifies that an exception is raised on expansion when a context contains an invalid @language",
+      "input": "error-0009-in.jsonld",
+      "expect": "invalid default language"
     }
   ]
 }