aboutsummaryrefslogtreecommitdiff
path: root/src/core/url_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/url_test.c')
-rw-r--r--src/core/url_test.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/url_test.c b/src/core/url_test.c
index 6504ff6c..232cabc8 100644
--- a/src/core/url_test.c
+++ b/src/core/url_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -54,8 +54,7 @@ test_url_host_port_path(void)
{
nng_url *url;
- NUTS_PASS(
- nng_url_parse(&url, "http://www.google.com:1234/somewhere"));
+ NUTS_PASS(nng_url_parse(&url, "http://www.google.com:1234/somewhere"));
NUTS_ASSERT(url != NULL);
NUTS_TRUE(strcmp(url->u_scheme, "http") == 0);
NUTS_TRUE(strcmp(url->u_host, "www.google.com:1234") == 0);
@@ -310,6 +309,8 @@ test_url_bad_scheme(void)
NUTS_NULL(url);
NUTS_FAIL(nng_url_parse(&url, "http:www.google.com"), NNG_EINVAL);
NUTS_NULL(url);
+ NUTS_FAIL(nng_url_parse(&url, "nosuch://bogus"), NNG_ENOTSUP);
+ NUTS_NULL(url);
}
void
@@ -327,7 +328,7 @@ test_url_canonify(void)
{
nng_url *url = NULL;
NUTS_PASS(nng_url_parse(
- &url, "hTTp://www.EXAMPLE.com/bogus/.%2e/%7egarrett"));
+ &url, "http://www.EXAMPLE.com/bogus/.%2e/%7egarrett"));
NUTS_ASSERT(url != NULL);
NUTS_MATCH(url->u_scheme, "http");
NUTS_MATCH(url->u_hostname, "www.example.com");
@@ -469,4 +470,4 @@ NUTS_TESTS = {
{ "url good utf8", test_url_good_utf8 },
{ "url decode", test_url_decode },
{ NULL, NULL },
-}; \ No newline at end of file
+};