mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-19 20:02:52 +02:00
improve completion test coverage
This commit is contained in:
@@ -34,6 +34,7 @@ int main (int argc, char *argv[])
|
|||||||
gchar *prefix;
|
gchar *prefix;
|
||||||
|
|
||||||
cmp = g_completion_new (NULL);
|
cmp = g_completion_new (NULL);
|
||||||
|
g_completion_set_compare (cmp, strncmp);
|
||||||
|
|
||||||
items = NULL;
|
items = NULL;
|
||||||
items = g_list_append (items, "a\302\243");
|
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);
|
items = g_completion_complete_utf8 (cmp, "a", NULL);
|
||||||
g_assert (g_list_length (items) == 2);
|
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);
|
g_completion_free (cmp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user