tests: Add some tests for expanding invalid escapes with g_strcompress()

This brings the branch coverage of `g_strcompress()` up to 100%. Yay.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2020-07-26 23:22:06 +01:00
parent 59eb3c5bdb
commit 1ef6e84012

View File

@ -741,6 +741,12 @@ test_strcompress_strescape (void)
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() */