Skip to content

Commit 978be2d

Browse files
committed
Add test for fragment identifier with base.
1 parent 4f58448 commit 978be2d

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

tests/expand-manifest.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,14 @@
14651465
"input": "expand/h021-in.html",
14661466
"expect": "expand/h021-out.jsonld",
14671467
"option": {"specVersion": "json-ld-1.1", "base": "http://a.example.com/doc"}
1468+
}, {
1469+
"@id": "#th022",
1470+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1471+
"name": "Expands targeted JSON-LD script element with fragment and HTML base",
1472+
"purpose": "Tests embedded JSON-LD in HTML with fragment identifier",
1473+
"input": "expand/h022-in.html#second",
1474+
"expect": "expand/h022-out.jsonld",
1475+
"option": {"specVersion": "json-ld-1.1"}
14681476
}, {
14691477
"@id": "#tm001",
14701478
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],

tests/expand/h022-in.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<html>
2+
<head>
3+
<base href="http://a.example.com/base" />
4+
<script id="first" type="application/ld+json">
5+
{
6+
"@context": {
7+
"foo": {"@id": "http://example.com/foo"}
8+
},
9+
"foo": [{"@value": "bar"}]
10+
}
11+
</script>
12+
<script id="second" type="application/ld+json">
13+
{
14+
"@context": {"ex": "http://example.com/"},
15+
"@id": "",
16+
"ex:bar": "foo"
17+
}
18+
</script>
19+
</head>
20+
</html>

tests/expand/h022-out.jsonld

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[{
2+
"@id": "http://a.example.com/base",
3+
"http://example.com/bar": [{"@value": "foo"}]
4+
}]

0 commit comments

Comments
 (0)