From ef82d4792bf59b1fe8053d9bb5ac924b443d8a78 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 17 Nov 2024 15:27:02 -0800 Subject: intern URL scheme --- src/core/url_test.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/core/url_test.c') 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. +// Copyright 2024 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // 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 +}; -- cgit v1.2.3-70-g09d2