Skip to content

Commit f655fcd

Browse files
davidlehngkellogg
authored andcommitted
Add graph container null context protection test.
1 parent a41bae0 commit f655fcd

File tree

6 files changed

+83
-0
lines changed

6 files changed

+83
-0
lines changed

tests/expand-manifest.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2858,6 +2858,14 @@
28582858
"option": {"specVersion": "json-ld-1.1"},
28592859
"input": "expand/pr42-in.jsonld",
28602860
"expectErrorCode": "protected term redefinition"
2861+
}, {
2862+
"@id": "#tpr43",
2863+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
2864+
"name": "Clear protection in @graph @container with null context.",
2865+
"purpose": "Clear protection in @graph @container with null context.",
2866+
"option": {"specVersion": "json-ld-1.1"},
2867+
"input": "expand/pr43-in.jsonld",
2868+
"expect": "expand/pr43-out.jsonld"
28612869
}, {
28622870
"@id": "#tso01",
28632871
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],

tests/expand/pr43-in.jsonld

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"@context": {
3+
"@protected": true,
4+
"protected": {
5+
"@id": "ex:protected1",
6+
"@type": "@id"
7+
},
8+
"unprotected": {
9+
"@id": "ex:unprotected",
10+
"@type": "@id",
11+
"@container": "@graph",
12+
"@context": null
13+
}
14+
},
15+
"@id": "ex:outer",
16+
"unprotected": {
17+
"@context": {
18+
"protected": "ex:protected2"
19+
},
20+
"@id": "ex:inner",
21+
"protected": "p === ex:protected2"
22+
}
23+
}

tests/expand/pr43-out.jsonld

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[
2+
{
3+
"@id": "ex:outer",
4+
"ex:unprotected": [
5+
{
6+
"@graph": [
7+
{
8+
"@id": "ex:inner",
9+
"ex:protected2": [
10+
{
11+
"@value": "p === ex:protected2"
12+
}
13+
]
14+
}
15+
]
16+
}
17+
]
18+
}
19+
]

tests/toRdf-manifest.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,6 +3387,14 @@
33873387
"option": {"specVersion": "json-ld-1.1"},
33883388
"input": "toRdf/pr42-in.jsonld",
33893389
"expectErrorCode": "protected term redefinition"
3390+
}, {
3391+
"@id": "#tpr43",
3392+
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
3393+
"name": "Clear protection in @graph @container with null context.",
3394+
"purpose": "Clear protection in @graph @container with null context.",
3395+
"option": {"specVersion": "json-ld-1.1"},
3396+
"input": "toRdf/pr43-in.jsonld",
3397+
"expect": "toRdf/pr43-out.nq"
33903398
}, {
33913399
"@id": "#trt01",
33923400
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],

tests/toRdf/pr43-in.jsonld

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"@context": {
3+
"@protected": true,
4+
"protected": {
5+
"@id": "ex:protected1",
6+
"@type": "@id"
7+
},
8+
"unprotected": {
9+
"@id": "ex:unprotected",
10+
"@type": "@id",
11+
"@container": "@graph",
12+
"@context": null
13+
}
14+
},
15+
"@id": "ex:outer",
16+
"unprotected": {
17+
"@context": {
18+
"protected": "ex:protected2"
19+
},
20+
"@id": "ex:inner",
21+
"protected": "p === ex:protected2"
22+
}
23+
}

tests/toRdf/pr43-out.nq

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<ex:outer> <ex:unprotected> _:b0 .
2+
<ex:inner> <ex:protected2> "p === ex:protected2" _:b0 .

0 commit comments

Comments
 (0)