diff options
author | David Robillard <d@drobilla.net> | 2018-05-11 15:28:43 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-06-10 19:57:44 +0000 |
commit | d208424fdb4e8b516aff2a5a0d03fc7411909471 (patch) | |
tree | b293d21b26329c6522bd6cb769f30917c14f1bf1 /tests | |
parent | 480744aab736a669c548cb5ced68866c3ebffb4e (diff) | |
download | serd-d208424fdb4e8b516aff2a5a0d03fc7411909471.tar.gz serd-d208424fdb4e8b516aff2a5a0d03fc7411909471.tar.bz2 serd-d208424fdb4e8b516aff2a5a0d03fc7411909471.zip |
Fix relative URI serialisation
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index b80c8b82..945fefe3 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -408,6 +408,18 @@ main(void) FAILF("Bad relative URI %s (expected '/foo/bar')\n", rel.buf); } + SerdNode up = serd_node_new_relative_uri(&base_uri, &abs_uri, NULL, NULL); + if (strcmp((const char*)up.buf, "../")) { + FAILF("Bad relative URI %s (expected '../')\n", up.buf); + } + + SerdNode noup = serd_node_new_relative_uri(&base_uri, &abs_uri, &abs_uri, NULL); + if (strcmp((const char*)noup.buf, "http://example.org/")) { + FAILF("Bad relative URI %s (expected 'http://example.org/')\n", noup.buf); + } + + serd_node_free(&noup); + serd_node_free(&up); serd_node_free(&rel); serd_node_free(&base); |