Skip to content

Commit 4fc0e14

Browse files
committed
Add language-map expansion test
This test assumes that the language is injected as the default language into the active context. Depending on the outcome of issue #159 this test might need to be updated. This addresses #133.
1 parent 2dc282b commit 4fc0e14

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"@context": {
3+
"vocab": "http://example.com/vocab/",
4+
"label": {
5+
"@id": "vocab:label",
6+
"@container": "@language"
7+
}
8+
},
9+
"@id": "http://example.com/queen",
10+
"label": {
11+
"en": "The Queen",
12+
"de": [ "Die Königin", "Ihre Majestät" ],
13+
"xx": {
14+
"@context": {
15+
"prop": "vocab:aPropertyJustToTestIfDefaultLangIsInjected"
16+
},
17+
"@id": "http://example.com/nested",
18+
"prop": "This is a string tagged with the language xx"
19+
}
20+
}
21+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[
2+
{
3+
"@id": "http://example.com/queen",
4+
"http://example.com/vocab/label":
5+
[
6+
{
7+
"@value": "The Queen",
8+
"@language": "en"
9+
}, {
10+
"@value": "Die Königin",
11+
"@language": "de"
12+
}, {
13+
"@value": "Ihre Majestät",
14+
"@language": "de"
15+
}, {
16+
"@id": "http://example.com/nested",
17+
"http://example.com/vocab/aPropertyJustToTestIfDefaultLangIsInjected":
18+
[
19+
{
20+
"@value": "This is a string tagged with the language xx",
21+
"@language": "xx"
22+
}
23+
]
24+
}
25+
]
26+
}
27+
]

test-suite/tests/expand-manifest.jsonld

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@
151151
"name": "Relative IRIs",
152152
"input": "expand-0029-in.jsonld",
153153
"expect": "expand-0029-out.jsonld"
154+
}, {
155+
"@type": ["test:TestCase", "jld:ExpandTest"],
156+
"name": "Language maps",
157+
"input": "expand-0030-in.jsonld",
158+
"expect": "expand-0030-out.jsonld"
154159
}
155160
]
156161
}

0 commit comments

Comments
 (0)