Skip to content

Commit

Permalink
Add #mixed-script-types test
Browse files Browse the repository at this point in the history
  • Loading branch information
anatoly-scherbakov committed Jul 7, 2024
1 parent cc78306 commit 6fc8cf7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/cases/html/mixed-types.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<html>
<head>
<script type="application/ld+yaml">
"@context": https://json-ld.org/contexts/person.jsonld
"@id": https://dbpedia.org/resource/John_Lennon
name: John Lennon
born: 1940-10-09
spouse:
- https://dbpedia.org/resource/Yoko_Ono
- https://dbpedia.org/resource/Cynthia_Lennon
---
"@context": https://json-ld.org/contexts/person.jsonld
"@id": https://dbpedia.org/resource/Yoko_Ono
born: 1933-02-18
</script>
</head>
<body>
<h1>Hi!</h1>

<script type="application/ld+json">
{
"@context": "https://json-ld.org/contexts/person.jsonld",
"@id": "https://dbpedia.org/resource/Cynthia_Lennon",
"born": "1939-09-10"
}
</script>
</body>
</html>
9 changes: 9 additions & 0 deletions tests/manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,15 @@
"input": "cases/html/stream.html",
"expect": "cases/html/stream.yamlld"
},
{
"@id": "#mixed-script-types",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "YAML Stream with multiple documents embedded into HTML, having JSON-LD and YAML-LD documents in them.",
"req": "must",
"option": {"extractAllScripts": true},
"input": "cases/html/mixed-types.html",
"expect": "cases/html/stream.yamlld"
},
{
"@id": "#html-dedent-needed",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
Expand Down

0 comments on commit 6fc8cf7

Please sign in to comment.