Skip to content

Commit

Permalink
Add graph container null context protection test.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlehn committed Dec 6, 2023
1 parent f18efc9 commit 626350a
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/expand-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -2843,6 +2843,14 @@
"option": {"specVersion": "json-ld-1.1"},
"input": "expand/pr41-in.jsonld",
"expect": "expand/pr41-out.jsonld"
}, {
"@id": "#tpr42",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Clear protection in @graph @container with null context.",
"purpose": "Clear protection in @graph @container with null context.",
"option": {"specVersion": "json-ld-1.1"},
"input": "expand/pr42-in.jsonld",
"expect": "expand/pr42-out.jsonld"
}, {
"@id": "#tso01",
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],
Expand Down
23 changes: 23 additions & 0 deletions tests/expand/pr42-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"@context": {
"@protected": true,
"protected": {
"@id": "ex:protected1",
"@type": "@id"
},
"unprotected": {
"@id": "ex:unprotected",
"@type": "@id",
"@container": "@graph",
"@context": null
}
},
"@id": "ex:outer",
"unprotected": {
"@context": {
"protected": "ex:protected2"
},
"@id": "ex:inner",
"protected": "p === ex:protected2"
}
}
19 changes: 19 additions & 0 deletions tests/expand/pr42-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[
{
"@id": "ex:outer",
"ex:unprotected": [
{
"@graph": [
{
"@id": "ex:inner",
"ex:protected2": [
{
"@value": "p === ex:protected2"
}
]
}
]
}
]
}
]
8 changes: 8 additions & 0 deletions tests/toRdf-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -3372,6 +3372,14 @@
"option": {"specVersion": "json-ld-1.1"},
"input": "toRdf/pr41-in.jsonld",
"expect": "toRdf/pr41-out.nq"
}, {
"@id": "#tpr42",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
"name": "Clear protection in @graph @container with null context.",
"purpose": "Clear protection in @graph @container with null context.",
"option": {"specVersion": "json-ld-1.1"},
"input": "toRdf/pr42-in.jsonld",
"expect": "toRdf/pr42-out.nq"
}, {
"@id": "#trt01",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
Expand Down
23 changes: 23 additions & 0 deletions tests/toRdf/pr42-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"@context": {
"@protected": true,
"protected": {
"@id": "ex:protected1",
"@type": "@id"
},
"unprotected": {
"@id": "ex:unprotected",
"@type": "@id",
"@container": "@graph",
"@context": null
}
},
"@id": "ex:outer",
"unprotected": {
"@context": {
"protected": "ex:protected2"
},
"@id": "ex:inner",
"protected": "p === ex:protected2"
}
}
2 changes: 2 additions & 0 deletions tests/toRdf/pr42-out.nq
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<ex:outer> <ex:unprotected> _:b0 .
<ex:inner> <ex:protected2> "p === ex:protected2" _:b0 .

0 comments on commit 626350a

Please sign in to comment.