Skip to content

Commit 08c52bc

Browse files
pchampingkellogg
authored andcommitted
verify that compact IRIs and terms as @vocab expand properly
1 parent 83a39d2 commit 08c52bc

File tree

5 files changed

+53
-0
lines changed

5 files changed

+53
-0
lines changed

tests/expand-manifest.jsonld

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,22 @@
14041404
"input": "expand/e044-in.jsonld",
14051405
"expect": "invalid IRI mapping",
14061406
"option": {"specVersion": "json-ld-1.1"}
1407+
}, {
1408+
"@id": "#te046",
1409+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1410+
"name": "compact IRI as @vocab",
1411+
"purpose": "Verifies that @vocab defined as a compact IRI expands properly",
1412+
"input": "expand/e046-in.jsonld",
1413+
"expect": "expand/e046-out.jsonld",
1414+
"option": {"specVersion": "json-ld-1.1"}
1415+
}, {
1416+
"@id": "#te047",
1417+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1418+
"name": "term as @vocab",
1419+
"purpose": "Verifies that @vocab defined as a term expands properly",
1420+
"input": "expand/e047-in.jsonld",
1421+
"expect": "expand/e047-out.jsonld",
1422+
"option": {"specVersion": "json-ld-1.1"}
14071423
}, {
14081424
"@id": "#tec01",
14091425
"@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ],

tests/expand/e046-in.jsonld

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"@vocab": "ex:ns/",
5+
"ex": {
6+
"@id": "http://example.org/",
7+
"@prefix": true
8+
}
9+
},
10+
"foo": "bar"
11+
}

tests/expand/e046-out.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[
2+
{
3+
"http://example.org/ns/foo": [
4+
{
5+
"@value": "bar"
6+
}
7+
]
8+
}
9+
]

tests/expand/e047-in.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"@vocab": "ex",
5+
"ex": "http://example.org/",
6+
},
7+
"foo": "bar"
8+
}

tests/expand/e047-out.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[
2+
{
3+
"http://example.org/foo": [
4+
{
5+
"@value": "bar"
6+
}
7+
]
8+
}
9+
]

0 commit comments

Comments
 (0)