diff options
author | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2006-01-01 18:58:00 +0000 |
---|---|---|
committer | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2006-01-01 18:58:00 +0000 |
commit | 3000983b54810a9646160b56170144c46da03338 (patch) | |
tree | 685114400ad96fa12bd7eafdbf6c737d31c4ebd8 /test/uri-tests.c | |
parent | 38426abfd24e1d2d321f2387c3e93753757932a6 (diff) | |
download | neon-3000983b54810a9646160b56170144c46da03338.tar.gz |
* src/ne_uri.c (remove_dot_segments): Fix case 2.A.
(copy_authority): Fix to duplicate userinfo if defined.
(ne_uri_resolve): Fix to only copy scheme if defined.
(ne_uri_unparse): Fix handling of URIs with authority but no scheme.
* test/uri-tests.c (unparse, resolve): Add test cases for above.
git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@813 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'test/uri-tests.c')
-rw-r--r-- | test/uri-tests.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/test/uri-tests.c b/test/uri-tests.c index cf9eb38..74d77a5 100644 --- a/test/uri-tests.c +++ b/test/uri-tests.c @@ -345,6 +345,7 @@ static int unparse(void) "http://a/b?c", "http://a/b#d", "mailto:foo@bar.com", + "//foo.com/bar", NULL }; int n; @@ -356,7 +357,7 @@ static int unparse(void) ONV(ne_uri_parse(uris[n], &parsed), ("failed to parse %s", uris[n])); - if (parsed.port == 0) + if (parsed.port == 0 && parsed.scheme) parsed.port = ne_uri_defaultport(parsed.scheme); unp = ne_uri_unparse(&parsed); @@ -421,6 +422,28 @@ static int resolve(void) { BASE, "g#s/./x", "http://a/b/c/g#s/./x" }, { BASE, "g#s/../x", "http://a/b/c/g#s/../x" }, { BASE, "http:g", "http:g" }, + /* Additional examples: */ + { BASE, ".", "http://a/b/c/" }, + { "http://foo.com/alpha/beta", "../gamma", "http://foo.com/gamma" }, + { "http://foo.com/alpha//beta", "../gamma", "http://foo.com/alpha/gamma" }, + + { "http://foo.com", "../gamma", "http://foo.com/gamma" }, + { "", "zzz:.", "zzz:" }, + { "", "zzz:./foo", "zzz:foo" }, + { "", "zzz:../foo", "zzz:foo" }, + { "", "zzz:/./foo", "zzz:/foo" }, + { "", "zzz:/.", "zzz:/" }, + { "", "zzz:/../", "zzz:/" }, + { "", "zzz:.", "zzz:" }, + { "", "zzz:..", "zzz:" }, + { "", "zzz://foo@bar/", "zzz://foo@bar/" }, + { "", "zzz://foo/?bar", "zzz://foo/?bar" }, + { "zzz://foo/?bar", "//baz/?jam", "zzz://baz/?jam" }, + { "zzz://foo/baz?biz", "", "zzz://foo/baz?biz" }, + { "zzz://foo/baz", "", "zzz://foo/baz" }, + { "//foo/baz", "", "//foo/baz" }, + + { NULL, NULL, NULL } }; size_t n; |