aboutsummaryrefslogtreecommitdiff
path: root/tests/url.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/url.c')
-rw-r--r--tests/url.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/url.c b/tests/url.c
index 019a1519..6fb35596 100644
--- a/tests/url.c
+++ b/tests/url.c
@@ -29,6 +29,7 @@ TestMain("URLs", {
So(strcmp(url->u_hostname, "www.google.com") == 0);
So(strcmp(url->u_port, "") == 0);
So(strcmp(url->u_path, "") == 0);
+ So(strcmp(url->u_rawpath, "") == 0);
So(url->u_query == NULL);
So(url->u_fragment == NULL);
So(url->u_userinfo == NULL);
@@ -43,6 +44,7 @@ TestMain("URLs", {
So(strcmp(url->u_hostname, "www.google.com") == 0);
So(strcmp(url->u_port, "1234") == 0);
So(strcmp(url->u_path, "") == 0);
+ So(strcmp(url->u_rawpath, "") == 0);
So(url->u_query == NULL);
So(url->u_fragment == NULL);
So(url->u_userinfo == NULL);
@@ -58,6 +60,7 @@ TestMain("URLs", {
So(strcmp(url->u_hostname, "www.google.com") == 0);
So(strcmp(url->u_port, "1234") == 0);
So(strcmp(url->u_path, "/somewhere") == 0);
+ So(strcmp(url->u_rawpath, "/somewhere") == 0);
So(url->u_userinfo == NULL);
So(url->u_query == NULL);
So(url->u_fragment == NULL);
@@ -73,6 +76,7 @@ TestMain("URLs", {
So(strcmp(url->u_hostname, "www.google.com") == 0);
So(strcmp(url->u_port, "1234") == 0);
So(strcmp(url->u_path, "/somewhere") == 0);
+ So(strcmp(url->u_rawpath, "/somewhere") == 0);
So(url->u_query == NULL);
So(url->u_fragment == NULL);
nni_url_free(url);
@@ -87,6 +91,7 @@ TestMain("URLs", {
So(strcmp(url->u_port, "") == 0);
So(strcmp(url->u_path, "/somewhere") == 0);
So(strcmp(url->u_query, "result=yes") == 0);
+ So(strcmp(url->u_rawpath, "/somewhere?result=yes") == 0);
So(url->u_userinfo == NULL);
So(url->u_fragment == NULL);
nni_url_free(url);
@@ -103,6 +108,8 @@ TestMain("URLs", {
So(strcmp(url->u_path, "/somewhere") == 0);
So(strcmp(url->u_query, "result=yes") == 0);
So(strcmp(url->u_fragment, "chapter1") == 0);
+ So(strcmp(url->u_rawpath, "/somewhere?result=yes#chapter1") ==
+ 0);
So(url->u_userinfo == NULL);
nni_url_free(url);
});
@@ -116,6 +123,7 @@ TestMain("URLs", {
So(strcmp(url->u_port, "") == 0);
So(strcmp(url->u_path, "/somewhere") == 0);
So(strcmp(url->u_fragment, "chapter2") == 0);
+ So(strcmp(url->u_rawpath, "/somewhere#chapter2") == 0);
So(url->u_query == NULL);
So(url->u_userinfo == NULL);
nni_url_free(url);
@@ -129,6 +137,7 @@ TestMain("URLs", {
So(strcmp(url->u_path, "") == 0);
So(strcmp(url->u_port, "") == 0);
So(strcmp(url->u_fragment, "chapter3") == 0);
+ So(strcmp(url->u_rawpath, "#chapter3") == 0);
So(url->u_query == NULL);
So(url->u_userinfo == NULL);
nni_url_free(url);
@@ -143,6 +152,7 @@ TestMain("URLs", {
So(strcmp(url->u_path, "") == 0);
So(strcmp(url->u_port, "") == 0);
So(strcmp(url->u_query, "color=red") == 0);
+ So(strcmp(url->u_rawpath, "?color=red") == 0);
So(url->u_fragment == NULL);
So(url->u_userinfo == NULL);
nni_url_free(url);