diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2017-03-27 17:55:48 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2017-03-27 17:55:48 +0100 |
commit | f90559d2db0132e877adff474895600d9c8fe65f (patch) | |
tree | edaaadd6e4a1c1cac9946652d7cdbaa5b8ef5fe2 | |
parent | 775687a79bee65faece0986665b55ab6276b33a3 (diff) | |
download | netsurf-f90559d2db0132e877adff474895600d9c8fe65f.tar.gz netsurf-f90559d2db0132e877adff474895600d9c8fe65f.tar.bz2 |
Tests: Increase nsurl coverage.
-rw-r--r-- | test/nsurl.c | 11 |
1 files changed, 11 insertions, 0 deletions
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://<!--#echo var=", "http://<!--/#echo%20var="}, /* [1] Extra slash beyond rfc3986 5.4.1 example, since we're * testing normalisation in addition to joining */ |