Add toRDF corner-case test (native "integer" type-coerced to xsd:double)
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Wed, 05 Jun 2013 20:21:53 +0200
changeset 1687 ee333d3fa153
parent 1686 823c5d21ae58
child 1688 cc9eb5b12935
child 1690 4b2824425af0
Add toRDF corner-case test (native "integer" type-coerced to xsd:double)
test-suite/tests/toRdf-0035-in.jsonld
test-suite/tests/toRdf-0035-out.nq
test-suite/tests/toRdf-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0035-in.jsonld	Wed Jun 05 20:21:53 2013 +0200
@@ -0,0 +1,14 @@
+{
+  "@context": {
+    "double": {
+      "@id": "http://example.com/double",
+      "@type": "http://www.w3.org/2001/XMLSchema#double"
+    },
+    "integer": {
+      "@id": "http://example.com/integer",
+      "@type": "http://www.w3.org/2001/XMLSchema#integer"
+    }
+  },
+  "double": [1, 2.2 ],
+  "integer": [8, 9.9 ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0035-out.nq	Wed Jun 05 20:21:53 2013 +0200
@@ -0,0 +1,4 @@
+_:b0 <http://example.com/double> "1.0E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:b0 <http://example.com/double> "2.2E0"^^<http://www.w3.org/2001/XMLSchema#double> .
+_:b0 <http://example.com/integer> "8"^^<http://www.w3.org/2001/XMLSchema#integer> .
+_:b0 <http://example.com/integer> "9.9E0"^^<http://www.w3.org/2001/XMLSchema#integer> .
--- a/test-suite/tests/toRdf-manifest.jsonld	Wed Jun 05 20:13:40 2013 +0200
+++ b/test-suite/tests/toRdf-manifest.jsonld	Wed Jun 05 20:21:53 2013 +0200
@@ -238,6 +238,12 @@
       "input": "toRdf-0034-in.jsonld",
       "expect": "toRdf-0034-out.nq"
     }, {
+      "@id": "#t0035",
+      "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
+      "name": "xsd:double's canonical lexical is used when converting numbers without fraction that are coerced to xsd:double",
+      "input": "toRdf-0035-in.jsonld",
+      "expect": "toRdf-0035-out.nq"
+    }, {
       "@id": "#t0041",
       "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
       "name": "drop free-floating nodes",