1
#include "gsd-keyboard-manager.c"
4
test_layout_from_ibus_layout (void)
7
const gchar *test_strings[][2] = {
15
for (i = 0; i < G_N_ELEMENTS (test_strings); ++i)
16
g_assert_cmpstr (layout_from_ibus_layout (test_strings[i][0]), ==, test_strings[i][1]);
20
test_variant_from_ibus_layout (void)
23
const gchar *test_strings[][2] = {
35
for (i = 0; i < G_N_ELEMENTS (test_strings); ++i)
36
g_assert_cmpstr (variant_from_ibus_layout (test_strings[i][0]), ==, test_strings[i][1]);
40
test_options_from_ibus_layout (void)
62
const gpointer tests[][2] = {
69
{ "a[b,]", output_3 },
70
{ "a[b,c]", output_4 },
73
for (i = 0; i < G_N_ELEMENTS (tests); ++i) {
74
if (tests[i][1] == NULL) {
75
g_assert (options_from_ibus_layout (tests[i][0]) == NULL);
77
gchar **strv_a = options_from_ibus_layout (tests[i][0]);
78
gchar **strv_b = tests[i][1];
80
g_assert (g_strv_length (strv_a) == g_strv_length (strv_b));
81
for (j = 0; j < g_strv_length (strv_a); ++j)
82
g_assert_cmpstr (strv_a[j], ==, strv_b[j]);
90
test_layout_from_ibus_layout ();
91
test_variant_from_ibus_layout ();
92
test_options_from_ibus_layout ();