Skip to content

Commit 603f429

Browse files
authored
Merge pull request #517 from json-ld/issue-302
Add tests based on those found to have been problematic in pyld.
2 parents 0b7f507 + 0d18756 commit 603f429

10 files changed

+71
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"@context": {
3+
"ns": "http://example.com/core#"
4+
}
5+
}
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"http://example.com/core#associated": { "@id": "#Light"}
3+
}
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"@context": {
3+
"ns": "http://example.com/core#"
4+
},
5+
"ns:associated": {
6+
"@id": "#Light"
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"@context": {"@base": "http://example.com/api/things/1"}
3+
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"@id": "http://example.com/api/things/1",
3+
"http://example.com": ""
4+
}
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"@context": {"@base": "http://example.com/api/things/1"},
3+
"@id": "1",
4+
"http://example.com": ""
5+
}

test-suite/tests/compact-manifest.jsonld

+18-1
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,23 @@
601601
"input": "compact-0074-in.jsonld",
602602
"context": "compact-0074-context.jsonld",
603603
"expect": "compact-0074-out.jsonld"
604+
}, {
605+
"@id": "#t0075",
606+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
607+
"name": "Compact using relative fragment identifier",
608+
"purpose": "Compacting a relative round-trips",
609+
"option": {"base": "http://example.org/"},
610+
"input": "compact-0075-in.jsonld",
611+
"context": "compact-0075-context.jsonld",
612+
"expect": "compact-0075-out.jsonld"
613+
}, {
614+
"@id": "#t0076",
615+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
616+
"name": "Compacting IRI equivalent to base",
617+
"purpose": "Compacting IRI equivalent to base, uses last path segment of base ending in '/'",
618+
"input": "compact-0076-in.jsonld",
619+
"context": "compact-0076-context.jsonld",
620+
"expect": "compact-0076-out.jsonld"
604621
}, {
605622
"@id": "#tc001",
606623
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
@@ -847,7 +864,7 @@
847864
}, {
848865
"@id": "#tp001",
849866
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
850-
"name": "Compact IRI does may use an expanded term definition in 1.0",
867+
"name": "Compact IRI may use an expanded term definition in 1.0",
851868
"purpose": "Terms with an expanded term definition may be used for creating compact IRIs",
852869
"option": {"processingMode": "json-ld-1.0"},
853870
"input": "compact-p001-in.jsonld",
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"@context": {
3+
"@base": "http://example.com/",
4+
"iot": "http://example.com/core/#"
5+
},
6+
"iot:associated": { "@id": "#Light" }
7+
}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"@id": "_:b0",
4+
"http://example.com/core/#associated": [
5+
{
6+
"@id": "http://example.com/#Light"
7+
}
8+
]
9+
}
10+
]

test-suite/tests/flatten-manifest.jsonld

+8
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,14 @@
332332
"purpose": "Usage of empty strings in identifiers needs special care when constructing the node map.",
333333
"input": "flatten-0046-in.jsonld",
334334
"expect": "flatten-0046-out.jsonld"
335+
}, {
336+
"@id": "#t0047",
337+
"@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
338+
"name": "Flatten using relative fragment identifier properly joins to base",
339+
"purpose": "Compacting a relative round-trips",
340+
"option": {"base": "http://example.org/"},
341+
"input": "flatten-0047-in.jsonld",
342+
"expect": "flatten-0047-out.jsonld"
335343
}
336344
]
337345
}

0 commit comments

Comments
 (0)