Commit 62a54a90 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Merge branch '4-strescape-utf8' into 'master'

Add some g_strescape() tests

Closes #4

See merge request !1584
parents 6a87f7ed 1ef6e840
Pipeline #199285 failed with stages
in 13 minutes and 8 seconds
......@@ -731,6 +731,22 @@ test_strcompress_strescape (void)
g_assert_cmpstr (str, ==, "abc\\\"\b\f\n\r\t\v\003\177\234\313");
g_free (str);
g_free (tmp);
/* Unicode round trip */
str = g_strescape ("héllø there⸘", NULL);
g_assert_nonnull (str);
g_assert_cmpstr (str, ==, "h\\303\\251ll\\303\\270 there\\342\\270\\230");
tmp = g_strcompress (str);
g_assert_nonnull (tmp);
g_assert_cmpstr (tmp, ==, "héllø there⸘");
g_free (tmp);
g_free (str);
/* Test expanding invalid escapes */
str = g_strcompress ("\\11/ \\118 \\8aa \\19");
g_assert_nonnull (str);
g_assert_cmpstr (str, ==, "\t/ \t8 8aa \0019");
g_free (str);
}
/* Testing g_ascii_strcasecmp() and g_ascii_strncasecmp() */
......
......@@ -382,7 +382,7 @@ test_uri_unescape_bytes (gconstpointer test_data)
tests[] =
{
{ "%00%00", NULL, 2, (const guint8 *) "\x00\x00" },
{ "/cursors/none.png", "/", 17, "/cursors/none.png" },
{ "/cursors/none.png", "/", 17, (const guint8 *) "/cursors/none.png" },
{ "/cursors%2fbad-subdir/none.png", "/", -1, NULL },
{ "%%", NULL, -1, NULL },
{ "%", NULL, -1, NULL },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment