[glib: 2/3] guri: add a test to check ipv6 with zoneid URI to string




commit 3bcc6fd39f2681f3ec64b795e4362aa034dec2f4
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Tue Aug 4 22:25:10 2020 +0400

    guri: add a test to check ipv6 with zoneid URI to string
    
    The test was failing since commit 20ae4b46d ("uri: do not add ipv6
    brackets on non-ip host").
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 glib/tests/uri.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/glib/tests/uri.c b/glib/tests/uri.c
index 99845c4d0..74ad24d98 100644
--- a/glib/tests/uri.c
+++ b/glib/tests/uri.c
@@ -915,7 +915,12 @@ test_uri_to_string (void)
   tostring = g_uri_to_string (uri);
   g_assert_cmpstr (tostring, ==, "scheme://userinfo@host:1234/path?query#fragment");
   g_free (tostring);
+  g_uri_unref (uri);
 
+  uri = g_uri_build (G_URI_FLAGS_NONE, "scheme", NULL, "fe80::dead:beef%em1", -1, "", NULL, NULL);
+  tostring = g_uri_to_string (uri);
+  g_assert_cmpstr (tostring, ==, "scheme://[fe80::dead:beef%25em1]");
+  g_free (tostring);
   g_uri_unref (uri);
 
   uri = g_uri_build_with_user (G_URI_FLAGS_NONE, "scheme", "user", "pass", "auth", "host", 1234,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]