[glib: 3/5] tests/uri: check user field is correctly encoded




commit c354c404c69d76164da21db13e7367df35fdc740
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Thu Jul 30 23:26:23 2020 +0400

    tests/uri: check user field is correctly encoded
    
    Suggested-by: Dan Winship <danw gnome org>
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 glib/tests/uri.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/glib/tests/uri.c b/glib/tests/uri.c
index 8b83dd55a..421a1284d 100644
--- a/glib/tests/uri.c
+++ b/glib/tests/uri.c
@@ -932,16 +932,16 @@ test_uri_to_string (void)
   g_uri_unref (uri);
 
   uri = g_uri_build_with_user (G_URI_FLAGS_HAS_PASSWORD|G_URI_FLAGS_HAS_AUTH_PARAMS,
-                               "scheme", "user", "pass", "auth", "host", 1234,
+                               "scheme", "us:er", "pass", "auth", "host", 1234,
                                "/path", "query", "fragment");
   tostring = g_uri_to_string (uri);
-  g_assert_cmpstr (tostring, ==, "scheme://user:pass;auth@host:1234/path?query#fragment");
+  g_assert_cmpstr (tostring, ==, "scheme://us%3Aer:pass;auth@host:1234/path?query#fragment");
   g_free (tostring);
   tostring = g_uri_to_string_partial (uri, G_URI_HIDE_PASSWORD);
-  g_assert_cmpstr (tostring, ==, "scheme://user;auth@host:1234/path?query#fragment");
+  g_assert_cmpstr (tostring, ==, "scheme://us%3Aer;auth@host:1234/path?query#fragment");
   g_free (tostring);
   tostring = g_uri_to_string_partial (uri, G_URI_HIDE_AUTH_PARAMS);
-  g_assert_cmpstr (tostring, ==, "scheme://user:pass@host:1234/path?query#fragment");
+  g_assert_cmpstr (tostring, ==, "scheme://us%3Aer:pass@host:1234/path?query#fragment");
   g_free (tostring);
   g_uri_unref (uri);
 }


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