summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2014-10-14 11:47:25 +0300
committerRan Benita <ran234@gmail.com>2014-10-14 11:47:25 +0300
commitc42b864654d766a12b12a10e8105158467440957 (patch)
tree70dd0afa8e9416a2ea771b6fc34f770063dbfe23
parent3f489730d348ee88e4c6efc218df803e6cf90adb (diff)
downloadxorg-lib-libxkbcommon-c42b864654d766a12b12a10e8105158467440957.tar.gz
test/compose: test include statement
Signed-off-by: Ran Benita <ran234@gmail.com>
-rw-r--r--test/compose.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/compose.c b/test/compose.c
index b8a004f..9bbef18 100644
--- a/test/compose.c
+++ b/test/compose.c
@@ -469,6 +469,42 @@ test_modifier_syntax(struct xkb_context *ctx)
fprintf(stderr, "<END bad input string>\n");
}
+static void
+test_include(struct xkb_context *ctx)
+{
+ char *path, *table_string;
+ int ret;
+
+ path = test_get_path("compose/en_US.UTF-8/Compose");
+ assert(path);
+
+ /* We don't have a mechanism to change the include paths like we
+ * have for keymaps. So we must include the full path. */
+ ret = asprintf(&table_string,
+ "<dead_tilde> <space> : \"foo\" X\n"
+ "include \"%s\"\n"
+ "<dead_tilde> <dead_tilde> : \"bar\" Y\n", path);
+ assert(ret >= 0);
+
+ assert(test_compose_seq_buffer(ctx, table_string,
+ /* No conflict. */
+ XKB_KEY_dead_acute, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
+ XKB_KEY_dead_acute, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "ยด", XKB_KEY_acute,
+
+ /* Comes before - doesn't override. */
+ XKB_KEY_dead_tilde, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
+ XKB_KEY_space, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "~", XKB_KEY_asciitilde,
+
+ /* Comes after - does override. */
+ XKB_KEY_dead_tilde, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
+ XKB_KEY_dead_tilde, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "bar", XKB_KEY_Y,
+
+ XKB_KEY_NoSymbol));
+
+ free(path);
+ free(table_string);
+}
+
int
main(int argc, char *argv[])
{
@@ -482,6 +518,7 @@ main(int argc, char *argv[])
test_XCOMPOSEFILE(ctx);
test_state(ctx);
test_modifier_syntax(ctx);
+ test_include(ctx);
xkb_context_unref(ctx);
return 0;