@@ -33,6 +33,30 @@ void resolveNull() {
33
33
assertEquals ("test.json" , iri .resolve ("test.json" ).toString ());
34
34
}
35
35
36
+ @ Test
37
+ void relativeColonDotPathSegment () {
38
+ AbsoluteIri iri = new AbsoluteIri ("http://www.example.org/foo/bar.json" );
39
+ assertEquals ("http://www.example.org/foo/foo:bar" , iri .resolve ("./foo:bar" ).toString ());
40
+ }
41
+
42
+ @ Test
43
+ void relativeColonSecondSegment () {
44
+ AbsoluteIri iri = new AbsoluteIri ("http://www.example.org/foo/bar.json" );
45
+ assertEquals ("http://www.example.org/foo/bar/foo:bar" , iri .resolve ("bar/foo:bar" ).toString ());
46
+ }
47
+
48
+ @ Test
49
+ void relativeColonQueryString () {
50
+ AbsoluteIri iri = new AbsoluteIri ("http://www.example.org/foo/bar.json" );
51
+ assertEquals ("http://www.example.org/foo/test.json?queryParam=foo:bar" , iri .resolve ("test.json?queryParam=foo:bar" ).toString ());
52
+ }
53
+
54
+ @ Test
55
+ void relativeColonAnchor () {
56
+ AbsoluteIri iri = new AbsoluteIri ("http://www.example.org/foo/bar.json" );
57
+ assertEquals ("http://www.example.org/foo/test.json#foo:bar" , iri .resolve ("test.json#foo:bar" ).toString ());
58
+ }
59
+
36
60
@ Test
37
61
void relativeAtDocument () {
38
62
AbsoluteIri iri = new AbsoluteIri ("http://www.example.org/foo/bar.json" );
@@ -93,6 +117,18 @@ void relativeParentWithSchemeSpecificPart() {
93
117
assertEquals ("classpath:resource/test.json" , iri .resolve ("../../test.json" ).toString ());
94
118
}
95
119
120
+ @ Test
121
+ void rootColonDotPathSegment () {
122
+ AbsoluteIri iri = new AbsoluteIri ("http://www.example.org/foo/bar.json" );
123
+ assertEquals ("http://www.example.org/foo:bar" , iri .resolve ("/foo:bar" ).toString ());
124
+ }
125
+
126
+ @ Test
127
+ void rootColonSecondSegment () {
128
+ AbsoluteIri iri = new AbsoluteIri ("http://www.example.org/foo/bar.json" );
129
+ assertEquals ("http://www.example.org/bar/foo:bar" , iri .resolve ("/bar/foo:bar" ).toString ());
130
+ }
131
+
96
132
@ Test
97
133
void rootAbsoluteAtDocument () {
98
134
AbsoluteIri iri = new AbsoluteIri ("http://www.example.org/foo/bar.json" );
0 commit comments