summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-08-01 02:11:15 -0400
committerMatthias Clasen <mclasen@redhat.com>2010-08-03 10:25:54 -0400
commit21d98dbc4b57783bc98f612ca459562bcd25bd5b (patch)
tree6089f77a037899d1f65b5612c83db5f05c7a9525 /tests
parent9b96e31968383619ff0a76212c5200022d62b23c (diff)
downloadglib-21d98dbc4b57783bc98f612ca459562bcd25bd5b.tar.gz
improve completion test coverage
Diffstat (limited to 'tests')
-rw-r--r--tests/completion-test.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/completion-test.c b/tests/completion-test.c
index bece9c34a..73eb20d33 100644
--- a/tests/completion-test.c
+++ b/tests/completion-test.c
@@ -34,6 +34,7 @@ int main (int argc, char *argv[])
gchar *prefix;
cmp = g_completion_new (NULL);
+ g_completion_set_compare (cmp, strncmp);
items = NULL;
items = g_list_append (items, "a\302\243");
@@ -68,6 +69,14 @@ int main (int argc, char *argv[])
items = g_completion_complete_utf8 (cmp, "a", NULL);
g_assert (g_list_length (items) == 2);
+ items = g_list_append (NULL, "bb");
+ g_completion_remove_items (cmp, items);
+
+ items = g_completion_complete_utf8 (cmp, "b", &prefix);
+ g_assert (!strcmp ("b", prefix));
+ g_assert (g_list_length (items) == 1);
+ g_free (prefix);
+
g_completion_free (cmp);
return 0;