summaryrefslogtreecommitdiff
path: root/testsuite/gtk/textiter.c
diff options
context:
space:
mode:
authorSébastien Wilmet <swilmet@gnome.org>2013-06-24 17:00:31 +0200
committerSébastien Wilmet <swilmet@gnome.org>2013-06-24 20:14:39 +0200
commitea4e88df868640ed727aa9a0ec11552673e94ccc (patch)
treef621cec84e9665703fe6dc86e3f43bbdad4657d5 /testsuite/gtk/textiter.c
parent99fa59c961121498820782d1faae0f1fe44beb1f (diff)
downloadgtk+-ea4e88df868640ed727aa9a0ec11552673e94ccc.tar.gz
textiter: bug fix in forward_search() and backward_search()
When the search is case sensitive, g_utf8_normalize() is not called, so the skip_decomp argument of the function forward_chars_with_skipping() must be FALSE. To verify that, when searching "éb", the count parameter of forward_chars_with_skipping() have a different value: - case sensitive: count = 2 - case insensitive: count = 3 (g_utf8_normalize() has been called) The commit adds unit tests that didn't pass before, and that now pass (without known regression, obviously). https://bugzilla.gnome.org/show_bug.cgi?id=702977
Diffstat (limited to 'testsuite/gtk/textiter.c')
-rw-r--r--testsuite/gtk/textiter.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/gtk/textiter.c b/testsuite/gtk/textiter.c
index 53c8eeba2e..5e2bd5f8a5 100644
--- a/testsuite/gtk/textiter.c
+++ b/testsuite/gtk/textiter.c
@@ -174,6 +174,18 @@ test_search (void)
check_found_forward ("This is some foo\nfoo text", "foo\nfoo", 0, 13, 20, "foo\nfoo");
check_found_backward ("This is some foo\nfoo text", "foo\nfoo", 0, 13, 20, "foo\nfoo");
check_not_found ("This is some foo\nfoo text", "Foo\nfoo", 0);
+
+ /* check also that different composition of utf8 characters
+ (e.g. accented letters) match */
+
+ check_found_forward ("This is some \303\200 text", "\303\200", 0, 13, 14, "\303\200");
+ check_found_forward ("This is some \303\200 text", "some \303\200", 0, 8, 14, "some \303\200");
+ check_found_forward ("This is some \303\200 text", "\303\200 text", 0, 13, 19, "\303\200 text");
+ check_found_forward ("This is some \303\200 text", "some \303\200 text", 0, 8, 19, "some \303\200 text");
+ check_found_backward ("This is some \303\240 text", "\303\240", 0, 13, 14, "\303\240");
+ check_found_backward ("This is some \303\240 text", "some \303\240", 0, 8, 14, "some \303\240");
+ check_found_backward ("This is some \303\240 text", "\303\240 text", 0, 13, 19, "\303\240 text");
+ check_found_backward ("This is some \303\240 text", "some \303\240 text", 0, 8, 19, "some \303\240 text");
}
static void