Skip to content

Commit c93c33b

Browse files
committed
Add tests for JSON literal as an empty array.
1 parent b6a2b2b commit c93c33b

File tree

8 files changed

+85
-0
lines changed

8 files changed

+85
-0
lines changed

tests/expand-manifest.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6472,6 +6472,34 @@ <h2>
64726472
</dd>
64736473
</dl>
64746474
</dd>
6475+
<dt id='tjs23'>
6476+
Test tjs23 Expand JSON literal (empty array).
6477+
</dt>
6478+
<dd>
6479+
<dl class='entry'>
6480+
<dt>id</dt>
6481+
<dd>#tjs23</dd>
6482+
<dt>Type</dt>
6483+
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
6484+
<dt>Purpose</dt>
6485+
<dd>Tests expanding property with @type @json to a JSON literal (empty array).</dd>
6486+
<dt>input</dt>
6487+
<dd>
6488+
<a href='expand/js23-in.jsonld'>expand/js23-in.jsonld</a>
6489+
</dd>
6490+
<dt>expect</dt>
6491+
<dd>
6492+
<a href='expand/js23-out.jsonld'>expand/js23-out.jsonld</a>
6493+
</dd>
6494+
<dt>Options</dt>
6495+
<dd>
6496+
<dl class='options'>
6497+
<dt>specVersion</dt>
6498+
<dd>json-ld-1.1</dd>
6499+
</dl>
6500+
</dd>
6501+
</dl>
6502+
</dd>
64756503
<dt id='tl001'>
64766504
Test tl001 Language map with null value
64776505
</dt>

tests/expand-manifest.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,6 +1943,14 @@
19431943
"input": "expand/js22-in.jsonld",
19441944
"expect": "expand/js22-out.jsonld",
19451945
"option": {"specVersion": "json-ld-1.1"}
1946+
}, {
1947+
"@id": "#tjs23",
1948+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1949+
"name": "Expand JSON literal (empty array).",
1950+
"purpose": "Tests expanding property with @type @json to a JSON literal (empty array).",
1951+
"input": "expand/js23-in.jsonld",
1952+
"expect": "expand/js23-out.jsonld",
1953+
"option": {"specVersion": "json-ld-1.1"}
19461954
}, {
19471955
"@id": "#tl001",
19481956
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],

tests/expand/js23-in.jsonld

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"http://example.org/vocab#null": {"@value": [], "@type": "@json"}
3+
}

tests/expand/js23-out.jsonld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[{
2+
"http://example.org/vocab#null": [{
3+
"@value": [],
4+
"@type": "@json"
5+
}]
6+
}]

tests/toRdf-manifest.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6205,6 +6205,34 @@ <h2>
62056205
</dd>
62066206
</dl>
62076207
</dd>
6208+
<dt id='tjs23'>
6209+
Test tjs23 Transform JSON literal (empty array).
6210+
</dt>
6211+
<dd>
6212+
<dl class='entry'>
6213+
<dt>id</dt>
6214+
<dd>#tjs23</dd>
6215+
<dt>Type</dt>
6216+
<dd>jld:PositiveEvaluationTest, jld:ToRDFTest</dd>
6217+
<dt>Purpose</dt>
6218+
<dd>Tests transforming property with @type @json to a JSON literal (empty array).</dd>
6219+
<dt>input</dt>
6220+
<dd>
6221+
<a href='toRdf/js23-in.jsonld'>toRdf/js23-in.jsonld</a>
6222+
</dd>
6223+
<dt>expect</dt>
6224+
<dd>
6225+
<a href='toRdf/js23-out.nq'>toRdf/js23-out.nq</a>
6226+
</dd>
6227+
<dt>Options</dt>
6228+
<dd>
6229+
<dl class='options'>
6230+
<dt>specVersion</dt>
6231+
<dd>json-ld-1.1</dd>
6232+
</dl>
6233+
</dd>
6234+
</dl>
6235+
</dd>
62086236
<dt id='tli01'>
62096237
Test tli01 @list containing @list
62106238
</dt>

tests/toRdf-manifest.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,6 +1892,14 @@
18921892
"input": "toRdf/js22-in.jsonld",
18931893
"expect": "toRdf/js22-out.nq",
18941894
"option": {"specVersion": "json-ld-1.1"}
1895+
}, {
1896+
"@id": "#tjs23",
1897+
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
1898+
"name": "Transform JSON literal (empty array).",
1899+
"purpose": "Tests transforming property with @type @json to a JSON literal (empty array).",
1900+
"input": "toRdf/js23-in.jsonld",
1901+
"expect": "toRdf/js23-out.nq",
1902+
"option": {"specVersion": "json-ld-1.1"}
18951903
}, {
18961904
"@id": "#tli01",
18971905
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],

tests/toRdf/js23-in.jsonld

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"http://example.org/vocab#null": {"@value": [], "@type": "@json"}
3+
}

tests/toRdf/js23-out.nq

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_:b0 <http://example.org/vocab#null> "[]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> .

0 commit comments

Comments
 (0)