Skip to content

Commit eb205fa

Browse files
davidlehngkellogg
authored andcommitted
Add test for @context redefinition.
1 parent 406dec7 commit eb205fa

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

tests/expand-manifest.jsonld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,13 @@
18191819
"purpose": "The value of @type in an expanded term definition object MUST be a string or null.",
18201820
"input": "expand/er55-in.jsonld",
18211821
"expectErrorCode": "invalid type mapping"
1822+
}, {
1823+
"@id": "#ter56",
1824+
"@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],
1825+
"name": "Invalid redefinition of @context keyword.",
1826+
"purpose": "Verifies that an exception is raise when attempting to redefine @context.",
1827+
"input": "expand/er56-in.jsonld",
1828+
"expectErrorCode": "keyword redefinition"
18221829
}, {
18231830
"@id": "#tes01",
18241831
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],

tests/expand/er56-in.jsonld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"@context": {
3+
"@context": {
4+
"p": "ex:p"
5+
}
6+
},
7+
"@id": "ex:1",
8+
"p": "value"
9+
}
10+

tests/toRdf-manifest.jsonld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,6 +2244,13 @@
22442244
"purpose": "The value of @type in an expanded term definition object MUST be a string or null.",
22452245
"input": "toRdf/er55-in.jsonld",
22462246
"expectErrorCode": "invalid type mapping"
2247+
}, {
2248+
"@id": "#ter56",
2249+
"@type": [ "jld:NegativeEvaluationTest", "jld:ToRDFTest" ],
2250+
"name": "Invalid redefinition of @context keyword.",
2251+
"purpose": "Verifies that an exception is raise when attempting to redefine @context.",
2252+
"input": "expand/er56-in.jsonld",
2253+
"expectErrorCode": "keyword redefinition"
22472254
}, {
22482255
"@id": "#tin01",
22492256
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],

tests/toRdf/er56-in.jsonld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"@context": {
3+
"@context": {
4+
"p": "ex:p"
5+
}
6+
},
7+
"@id": "ex:1",
8+
"p": "value"
9+
}
10+

0 commit comments

Comments
 (0)