Skip to content

Commit 020c9df

Browse files
committed
Improve test fromRdf#t0027.
- Improving the test coverage for use useNativeTypes algorithm in 8.5.2 2.4. - Remove the "True" and "False" boolean tests that can cause confusion that those words are special values. - Add tests using a value of "notnative" typed to boolean, integer, and double. These test that the type will be preserved when a native conversion does not happen.
1 parent 590f78d commit 020c9df

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

tests/fromRdf/0027-in.nq

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
<http://example.com/boolean-number> <http://example.com/example> "1"^^<http://www.w3.org/2001/XMLSchema#boolean> .
55
<http://example.com/boolean-number> <http://example.com/example> "0"^^<http://www.w3.org/2001/XMLSchema#boolean> .
66

7-
<http://example.com/boolean-object> <http://example.com/example> "True"^^<http://www.w3.org/2001/XMLSchema#boolean> .
8-
<http://example.com/boolean-object> <http://example.com/example> "False"^^<http://www.w3.org/2001/XMLSchema#boolean> .
7+
<http://example.com/boolean-object> <http://example.com/example> "notnative"^^<http://www.w3.org/2001/XMLSchema#boolean> .
98

109
<http://example.com/number-native> <http://example.com/example> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
1110

1211
<http://example.com/number-object> <http://example.com/example> "0.1e999999999999999"^^<http://www.w3.org/2001/XMLSchema#double> .
1312
<http://example.com/number-object> <http://example.com/example> "+INF"^^<http://www.w3.org/2001/XMLSchema#double> .
1413
<http://example.com/number-object> <http://example.com/example> "-INF"^^<http://www.w3.org/2001/XMLSchema#double> .
14+
15+
<http://example.com/number-object> <http://example.com/example> "notnative"^^<http://www.w3.org/2001/XMLSchema#integer> .
16+
<http://example.com/number-object> <http://example.com/example> "notnative"^^<http://www.w3.org/2001/XMLSchema#double> .

tests/fromRdf/0027-out.jsonld

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
"http://example.com/example": [
1919
{
2020
"@type": "http://www.w3.org/2001/XMLSchema#boolean",
21-
"@value": "True"
22-
},
23-
{
24-
"@type": "http://www.w3.org/2001/XMLSchema#boolean",
25-
"@value": "False"
21+
"@value": "notnative"
2622
}
2723
]
2824
},
@@ -46,6 +42,14 @@
4642
{
4743
"@type": "http://www.w3.org/2001/XMLSchema#double",
4844
"@value": "-INF"
45+
},
46+
{
47+
"@type": "http://www.w3.org/2001/XMLSchema#integer",
48+
"@value": "notnative"
49+
},
50+
{
51+
"@type": "http://www.w3.org/2001/XMLSchema#double",
52+
"@value": "notnative"
4953
}
5054
]
5155
}

0 commit comments

Comments
 (0)