Skip to content

Commit

Permalink
Add test for @context redefinition.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlehn committed Feb 7, 2024
1 parent f18efc9 commit ec175b4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/expand-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -1819,6 +1819,13 @@
"purpose": "The value of @type in an expanded term definition object MUST be a string or null.",
"input": "expand/er55-in.jsonld",
"expectErrorCode": "invalid type mapping"
}, {
"@id": "#ter56",
"@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],
"name": "Invalid redefinition of @context keyword.",
"purpose": "Verifies that an exception is raise when attempting to redefine @context.",
"input": "expand/er56-in.jsonld",
"expectErrorCode": "keyword redefinition"
}, {
"@id": "#tes01",
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],
Expand Down
10 changes: 10 additions & 0 deletions tests/expand/er56-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"@context": {
"@context": {
"p": "ex:p"
}
},
"@id": "ex:1",
"p": "value"
}

7 changes: 7 additions & 0 deletions tests/toRdf-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -2244,6 +2244,13 @@
"purpose": "The value of @type in an expanded term definition object MUST be a string or null.",
"input": "toRdf/er55-in.jsonld",
"expectErrorCode": "invalid type mapping"
}, {
"@id": "#ter56",
"@type": [ "jld:NegativeEvaluationTest", "jld:ToRDFTest" ],
"name": "Invalid redefinition of @context keyword.",
"purpose": "Verifies that an exception is raise when attempting to redefine @context.",
"input": "expand/er56-in.jsonld",
"expectErrorCode": "keyword redefinition"
}, {
"@id": "#tin01",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
Expand Down
10 changes: 10 additions & 0 deletions tests/toRdf/er56-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"@context": {
"@context": {
"p": "ex:p"
}
},
"@id": "ex:1",
"p": "value"
}

0 comments on commit ec175b4

Please sign in to comment.