diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-17 15:27:02 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-17 15:29:41 -0800 |
| commit | ef82d4792bf59b1fe8053d9bb5ac924b443d8a78 (patch) | |
| tree | db865bea3afc153b27ccef35335919d98723507f /src/core/url_test.c | |
| parent | 9ea51a5bd5828648c68dbfbc43b2edcde65e5262 (diff) | |
| download | nng-ef82d4792bf59b1fe8053d9bb5ac924b443d8a78.tar.gz nng-ef82d4792bf59b1fe8053d9bb5ac924b443d8a78.tar.bz2 nng-ef82d4792bf59b1fe8053d9bb5ac924b443d8a78.zip | |
intern URL scheme
Diffstat (limited to 'src/core/url_test.c')
| -rw-r--r-- | src/core/url_test.c | 11 |
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 +}; |
