mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
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>
This commit is contained in:
parent
4c20ea477c
commit
c354c404c6
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user