Skip to content

Commit 5185051

Browse files
committed
Add test case 0028
Test use native types flag with non-native values.
1 parent 590f78d commit 5185051

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

tests/fromRdf-manifest.jsonld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,16 @@
205205
},
206206
"input": "fromRdf/0027-in.nq",
207207
"expect": "fromRdf/0027-out.jsonld"
208+
}, {
209+
"@id": "#t0028",
210+
"@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
211+
"name": "use native types flag with non-native values",
212+
"purpose": "Ensure that useNativeTypes flag being true does not interfere with values that cannot be serialized into a native value.",
213+
"option": {
214+
"useNativeTypes": true
215+
},
216+
"input": "fromRdf/0028-in.nq",
217+
"expect": "fromRdf/0028-out.jsonld"
208218
}, {
209219
"@id": "#tdi01",
210220
"@type": [ "jld:PositiveEvaluationTest", "jld:FromRDFTest" ],

tests/fromRdf/0028-in.nq

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<http://example.com> <http://example.com/property> "string" .
2+
<http://example.com> <http://example.com/property> "hello"@en .
3+
<http://example.com> <http://example.com/property> "No"^^<http://www.w3.org/2001/XMLSchema#boolean> .
4+
<http://example.com> <http://example.com/property> "AAA"^^<http://www.w3.org/2001/XMLSchema#double> .
5+
<http://example.com> <http://example.com/property> "{\"x\": 1}"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

tests/fromRdf/0028-out.jsonld

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[
2+
{
3+
"@id": "http://example.com",
4+
"http://example.com/property": [
5+
{
6+
"@value": "AAA",
7+
"@type": "http://www.w3.org/2001/XMLSchema#double"
8+
},
9+
{
10+
"@value": {
11+
"x": 1
12+
},
13+
"@type": "@json"
14+
},
15+
{
16+
"@value": "No",
17+
"@type": "http://www.w3.org/2001/XMLSchema#boolean"
18+
},
19+
{
20+
"@value": "string"
21+
},
22+
{
23+
"@language": "en",
24+
"@value": "hello"
25+
}
26+
]
27+
}
28+
]

0 commit comments

Comments
 (0)