From ec175b4af122eed833505c845ca8e466c6bf89c5 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Tue, 6 Feb 2024 23:05:37 -0500 Subject: [PATCH] Add test for `@context` redefinition. --- tests/expand-manifest.jsonld | 7 +++++++ tests/expand/er56-in.jsonld | 10 ++++++++++ tests/toRdf-manifest.jsonld | 7 +++++++ tests/toRdf/er56-in.jsonld | 10 ++++++++++ 4 files changed, 34 insertions(+) create mode 100644 tests/expand/er56-in.jsonld create mode 100644 tests/toRdf/er56-in.jsonld diff --git a/tests/expand-manifest.jsonld b/tests/expand-manifest.jsonld index c18f12bb..56306e15 100644 --- a/tests/expand-manifest.jsonld +++ b/tests/expand-manifest.jsonld @@ -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"], diff --git a/tests/expand/er56-in.jsonld b/tests/expand/er56-in.jsonld new file mode 100644 index 00000000..157ec456 --- /dev/null +++ b/tests/expand/er56-in.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@context": { + "p": "ex:p" + } + }, + "@id": "ex:1", + "p": "value" +} + diff --git a/tests/toRdf-manifest.jsonld b/tests/toRdf-manifest.jsonld index b5448d5f..39bff97e 100644 --- a/tests/toRdf-manifest.jsonld +++ b/tests/toRdf-manifest.jsonld @@ -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"], diff --git a/tests/toRdf/er56-in.jsonld b/tests/toRdf/er56-in.jsonld new file mode 100644 index 00000000..157ec456 --- /dev/null +++ b/tests/toRdf/er56-in.jsonld @@ -0,0 +1,10 @@ +{ + "@context": { + "@context": { + "p": "ex:p" + } + }, + "@id": "ex:1", + "p": "value" +} +