Skip to content

Commit

Permalink
Add a new test suite (extra) for tests that aren't included in the of…
Browse files Browse the repository at this point in the history
…ficial test suite
  • Loading branch information
kazarena committed Oct 25, 2023
1 parent 7d71564 commit 4f03dd3
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ld/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ func TestSuite(t *testing.T) {
filepath.Join(testDir, "normalization", "manifest-urdna2015.jsonld"),
)

// extra tests that aren't covered by the official test suite

manifestList = append(manifestList,
filepath.Join(testDir, "extra-manifest.jsonld"),
)

dl := NewDefaultDocumentLoader(nil)
proc := NewJsonLdProcessor()
earlReport := NewEarlReport()
Expand Down
18 changes: 18 additions & 0 deletions ld/testdata/extra-manifest.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"@context": ["context.jsonld", {"@base": "extra-manifest"}],
"@id": "",
"@type": "mf:Manifest",
"name": "Expansion",
"description": "JSON-LD Expansion tests.",
"baseIri": "https://w3c.github.io/json-ld-api/tests/",
"sequence": [
{
"@id": "#ext0001",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "resolve nested contexts #76",
"purpose": "Ensure nested contexts are dereferenced",
"input": "extra/0001-in.jsonld",
"expect": "extra/0001-out.jsonld"
}
]
}
11 changes: 11 additions & 0 deletions ld/testdata/extra/0001-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"@context": [
{
"@context": {
"PropertyValue": "http://schema.org/#PropertyValue"
}
}
],
"@id":"https://foo.bar/baz",
"@type":"PropertyValue"
}
8 changes: 8 additions & 0 deletions ld/testdata/extra/0001-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"@id": "https://foo.bar/baz",
"@type": [
"http://schema.org/#PropertyValue"
]
}
]

0 comments on commit 4f03dd3

Please sign in to comment.