aboutsummaryrefslogtreecommitdiffstats
path: root/tests/serd_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-07-11 01:24:54 +0200
committerDavid Robillard <d@drobilla.net>2018-07-12 08:30:47 +0200
commit7e10a58373dbbb850c4f4daeb90ce2d9739da441 (patch)
tree34aec3ef2a1754310c252c299a9b14f910625975 /tests/serd_test.c
parent01ad406bd8defd4c11ebeaf53f45f7ddf4cc7717 (diff)
downloadserd-7e10a58373dbbb850c4f4daeb90ce2d9739da441.tar.gz
serd-7e10a58373dbbb850c4f4daeb90ce2d9739da441.tar.bz2
serd-7e10a58373dbbb850c4f4daeb90ce2d9739da441.zip
Fix making relative URIs that are shorter than, but under, the root
Diffstat (limited to 'tests/serd_test.c')
-rw-r--r--tests/serd_test.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index a987b153..e312ad04 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -422,6 +422,15 @@ main(void)
FAILF("Bad relative URI %s (expected 'http://example.org/')\n", noup.buf);
}
+ SerdNode x = serd_node_from_string(SERD_URI, USTR("http://example.org/foo/x"));
+ SerdURI x_uri;
+ serd_uri_parse(x.buf, &x_uri);
+
+ SerdNode x_rel = serd_node_new_relative_uri(&x_uri, &abs_uri, &abs_uri, NULL);
+ if (strcmp((const char*)x_rel.buf, "x")) {
+ FAILF("Bad relative URI %s (expected 'x')\n", x_rel.buf);
+ }
+
serd_node_free(&noup);
serd_node_free(&up);
serd_node_free(&rel);