aboutsummaryrefslogtreecommitdiff
path: root/tests/url.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-12-22 19:18:05 -0800
committerGarrett D'Amore <garrett@damore.org>2018-12-22 19:20:12 -0800
commitd00483eadbee48b820a8a79163c5296953b6f5cb (patch)
tree2124acb66086e03ae2d1c913910cb96496d91bcc /tests/url.c
parentf94a25d6fa2f75a7e4d64ac1f998c4c0f459c00a (diff)
downloadnng-d00483eadbee48b820a8a79163c5296953b6f5cb.tar.gz
nng-d00483eadbee48b820a8a79163c5296953b6f5cb.tar.bz2
nng-d00483eadbee48b820a8a79163c5296953b6f5cb.zip
Add some wild card validation tests for URLs.
These tests are intended to demonstrate that we are not affected by the bug described in #821.
Diffstat (limited to 'tests/url.c')
-rw-r--r--tests/url.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/url.c b/tests/url.c
index 15eb5d78..9b44dda4 100644
--- a/tests/url.c
+++ b/tests/url.c
@@ -223,6 +223,20 @@ TestMain("URLs", {
nng_url_free(url);
});
+ Convey("ws://*:12345/foobar", {
+ So(nng_url_parse(&url, "ws://*:12345/foobar") == 0);
+ So(url != NULL);
+ So(strcmp(url->u_scheme, "ws") == 0);
+ So(strcmp(url->u_host, ":12345") == 0);
+ So(strcmp(url->u_hostname, "") == 0);
+ So(strcmp(url->u_path, "/foobar") == 0);
+ So(strcmp(url->u_port, "12345") == 0);
+ So(url->u_query == NULL);
+ So(url->u_fragment == NULL);
+ So(url->u_userinfo == NULL);
+ nng_url_free(url);
+ });
+
Convey("ssh://user@host.example.com", {
So(nng_url_parse(&url, "ssh://user@host.example.com") == 0);
So(url != NULL);