From f90559d2db0132e877adff474895600d9c8fe65f Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 27 Mar 2017 17:55:48 +0100 Subject: Tests: Increase nsurl coverage. --- test/nsurl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/nsurl.c b/test/nsurl.c index 6c40fa674..ba024291b 100644 --- a/test/nsurl.c +++ b/test/nsurl.c @@ -116,6 +116,8 @@ static const struct test_pairs create_tests[] = { { "http://www.ns-b.org:/", "http://www.ns-b.org/" }, + { "http://///////////www.ns-b.org:/", + "http://www.ns-b.org/" }, { "http://u@www.ns-b.org:/hello", "http://u@www.ns-b.org/hello" }, { "http://u:p@www.ns-b.org:/hello", @@ -160,6 +162,12 @@ static const struct test_pairs create_tests[] = { /* bad escape */ { "http://%1g%G0/", "http://%1g%g0/" }, + + { " http://www.ns-b.org/", "http://www.ns-b.org/" }, + { "http://www.ns-b.org/ ", "http://www.ns-b.org/" }, + { "http://www.ns-b.org ", "http://www.ns-b.org/" }, + { "http://www.ns-b.org/?q ", "http://www.ns-b.org/?q" }, + { "http://www.ns-b.org/#f ", "http://www.ns-b.org/#f" }, }; /** @@ -422,6 +430,9 @@ static const struct test_pairs join_tests[] = { { " / ", "http://a/" }, { " ? ", "http://a/b/c/d;p?" }, { " h ", "http://a/b/c/h" }, + { "//foo?", "http://foo/?" }, + { "//foo#bar", "http://foo/#bar" }, + { "//foo/", "http://foo/" }, { "http://