2 * Copyright © 2014 Ran Benita <ran234@gmail.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
26 #include "xkbcommon/xkbcommon-compose.h"
31 compose_status_string(enum xkb_compose_status status)
34 case XKB_COMPOSE_NOTHING:
36 case XKB_COMPOSE_COMPOSING:
38 case XKB_COMPOSE_COMPOSED:
40 case XKB_COMPOSE_CANCELLED:
44 return "<invalid-status>";
48 feed_result_string(enum xkb_compose_feed_result result)
51 case XKB_COMPOSE_FEED_IGNORED:
53 case XKB_COMPOSE_FEED_ACCEPTED:
57 return "<invalid-result>";
61 * Feed a sequence of keysyms to a fresh compose state and test the outcome.
63 * The varargs consists of lines in the following format:
64 * <input keysym> <expected feed result> <expected status> <expected string> <expected keysym>
65 * Terminated by a line consisting only of XKB_KEY_NoSymbol.
68 test_compose_seq_va(struct xkb_compose_table *table, va_list ap)
71 struct xkb_compose_state *state;
74 state = xkb_compose_state_new(table, XKB_COMPOSE_STATE_NO_FLAGS);
77 for (int i = 1; ; i++) {
78 xkb_keysym_t input_keysym;
79 enum xkb_compose_feed_result result, expected_result;
80 enum xkb_compose_status status, expected_status;
81 const char *expected_string;
82 xkb_keysym_t keysym, expected_keysym;
84 input_keysym = va_arg(ap, xkb_keysym_t);
85 if (input_keysym == XKB_KEY_NoSymbol)
88 expected_result = va_arg(ap, enum xkb_compose_feed_result);
89 expected_status = va_arg(ap, enum xkb_compose_status);
90 expected_string = va_arg(ap, const char *);
91 expected_keysym = va_arg(ap, xkb_keysym_t);
93 result = xkb_compose_state_feed(state, input_keysym);
95 if (result != expected_result) {
96 fprintf(stderr, "after feeding %d keysyms:\n", i);
97 fprintf(stderr, "expected feed result: %s\n",
98 feed_result_string(expected_result));
99 fprintf(stderr, "got feed result: %s\n",
100 feed_result_string(result));
104 status = xkb_compose_state_get_status(state);
105 if (status != expected_status) {
106 fprintf(stderr, "after feeding %d keysyms:\n", i);
107 fprintf(stderr, "expected status: %s\n",
108 compose_status_string(expected_status));
109 fprintf(stderr, "got status: %s\n",
110 compose_status_string(status));
114 ret = xkb_compose_state_get_utf8(state, buffer, sizeof(buffer));
115 if (ret < 0 || (size_t) ret >= sizeof(buffer)) {
116 fprintf(stderr, "after feeding %d keysyms:\n", i);
117 fprintf(stderr, "expected string: %s\n", expected_string);
118 fprintf(stderr, "got error: %d\n", ret);
121 if (!streq(buffer, expected_string)) {
122 fprintf(stderr, "after feeding %d keysyms:\n", i);
123 fprintf(stderr, "expected string: %s\n", strempty(expected_string));
124 fprintf(stderr, "got string: %s\n", buffer);
128 keysym = xkb_compose_state_get_one_sym(state);
129 if (keysym != expected_keysym) {
130 fprintf(stderr, "after feeding %d keysyms:\n", i);
131 xkb_keysym_get_name(expected_keysym, buffer, sizeof(buffer));
132 fprintf(stderr, "expected keysym: %s\n", buffer);
133 xkb_keysym_get_name(keysym, buffer, sizeof(buffer));
134 fprintf(stderr, "got keysym (%#x): %s\n", keysym, buffer);
139 xkb_compose_state_unref(state);
143 xkb_compose_state_unref(state);
148 test_compose_seq(struct xkb_compose_table *table, ...)
153 ok = test_compose_seq_va(table, ap);
159 test_compose_seq_buffer(struct xkb_context *ctx, const char *buffer, ...)
163 struct xkb_compose_table *table;
164 table = xkb_compose_table_new_from_buffer(ctx, buffer, strlen(buffer), "",
165 XKB_COMPOSE_FORMAT_TEXT_V1,
166 XKB_COMPOSE_COMPILE_NO_FLAGS);
168 va_start(ap, buffer);
169 ok = test_compose_seq_va(table, ap);
171 xkb_compose_table_unref(table);
176 test_seqs(struct xkb_context *ctx)
178 struct xkb_compose_table *table;
182 path = test_get_path("compose/en_US.UTF-8/Compose");
183 file = fopen(path, "rb");
187 table = xkb_compose_table_new_from_file(ctx, file, "",
188 XKB_COMPOSE_FORMAT_TEXT_V1,
189 XKB_COMPOSE_COMPILE_NO_FLAGS);
193 assert(test_compose_seq(table,
194 XKB_KEY_dead_tilde, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
195 XKB_KEY_space, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "~", XKB_KEY_asciitilde,
198 assert(test_compose_seq(table,
199 XKB_KEY_dead_tilde, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
200 XKB_KEY_space, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "~", XKB_KEY_asciitilde,
201 XKB_KEY_dead_tilde, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
202 XKB_KEY_space, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "~", XKB_KEY_asciitilde,
205 assert(test_compose_seq(table,
206 XKB_KEY_dead_tilde, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
207 XKB_KEY_dead_tilde, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "~", XKB_KEY_asciitilde,
210 assert(test_compose_seq(table,
211 XKB_KEY_dead_acute, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
212 XKB_KEY_space, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "'", XKB_KEY_apostrophe,
213 XKB_KEY_Caps_Lock, XKB_COMPOSE_FEED_IGNORED, XKB_COMPOSE_COMPOSED, "'", XKB_KEY_apostrophe,
216 assert(test_compose_seq(table,
217 XKB_KEY_dead_acute, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
218 XKB_KEY_dead_acute, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "´", XKB_KEY_acute,
221 assert(test_compose_seq(table,
222 XKB_KEY_Multi_key, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
223 XKB_KEY_Shift_L, XKB_COMPOSE_FEED_IGNORED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
224 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
225 XKB_KEY_Caps_Lock, XKB_COMPOSE_FEED_IGNORED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
226 XKB_KEY_Control_L, XKB_COMPOSE_FEED_IGNORED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
227 XKB_KEY_T, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "@", XKB_KEY_at,
230 assert(test_compose_seq(table,
231 XKB_KEY_7, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
232 XKB_KEY_a, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
233 XKB_KEY_b, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
236 assert(test_compose_seq(table,
237 XKB_KEY_Multi_key, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
238 XKB_KEY_apostrophe, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
239 XKB_KEY_7, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_CANCELLED, "", XKB_KEY_NoSymbol,
240 XKB_KEY_7, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
241 XKB_KEY_Caps_Lock, XKB_COMPOSE_FEED_IGNORED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
244 xkb_compose_table_unref(table);
246 /* Make sure one-keysym sequences work. */
247 assert(test_compose_seq_buffer(ctx,
249 "<B> <A> : \"baz\" Y \n",
250 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "foo", XKB_KEY_X,
251 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "foo", XKB_KEY_X,
252 XKB_KEY_C, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
253 XKB_KEY_B, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
254 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "baz", XKB_KEY_Y,
257 /* No sequences at all. */
258 assert(test_compose_seq_buffer(ctx,
260 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
261 XKB_KEY_B, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
262 XKB_KEY_C, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
263 XKB_KEY_Multi_key, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
264 XKB_KEY_dead_acute, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
267 /* Only keysym - string derived from keysym. */
268 assert(test_compose_seq_buffer(ctx,
270 "<B> <A> : dollar \n"
271 "<C> : dead_acute \n",
272 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
273 XKB_KEY_B, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "X", XKB_KEY_X,
274 XKB_KEY_B, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
275 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "$", XKB_KEY_dollar,
276 XKB_KEY_C, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "", XKB_KEY_dead_acute,
279 /* Make sure a cancelling keysym doesn't start a new sequence. */
280 assert(test_compose_seq_buffer(ctx,
283 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
284 XKB_KEY_C, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_CANCELLED, "", XKB_KEY_NoSymbol,
285 XKB_KEY_D, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
286 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
287 XKB_KEY_C, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_CANCELLED, "", XKB_KEY_NoSymbol,
288 XKB_KEY_C, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
289 XKB_KEY_D, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "Y", XKB_KEY_Y,
294 test_conflicting(struct xkb_context *ctx)
296 // new is prefix of old
297 assert(test_compose_seq_buffer(ctx,
298 "<A> <B> <C> : \"foo\" A \n"
299 "<A> <B> : \"bar\" B \n",
300 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
301 XKB_KEY_B, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
302 XKB_KEY_C, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "foo", XKB_KEY_A,
305 // old is a prefix of new
306 assert(test_compose_seq_buffer(ctx,
307 "<A> <B> : \"bar\" B \n"
308 "<A> <B> <C> : \"foo\" A \n",
309 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
310 XKB_KEY_B, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
311 XKB_KEY_C, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "foo", XKB_KEY_A,
314 // new duplicate of old
315 assert(test_compose_seq_buffer(ctx,
316 "<A> <B> : \"bar\" B \n"
317 "<A> <B> : \"bar\" B \n",
318 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
319 XKB_KEY_B, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "bar", XKB_KEY_B,
320 XKB_KEY_C, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_NOTHING, "", XKB_KEY_NoSymbol,
323 // new same length as old #1
324 assert(test_compose_seq_buffer(ctx,
325 "<A> <B> : \"foo\" A \n"
326 "<A> <B> : \"bar\" B \n",
327 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
328 XKB_KEY_B, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "bar", XKB_KEY_B,
331 // new same length as old #2
332 assert(test_compose_seq_buffer(ctx,
333 "<A> <B> : \"foo\" A \n"
334 "<A> <B> : \"foo\" B \n",
335 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
336 XKB_KEY_B, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "foo", XKB_KEY_B,
339 // new same length as old #3
340 assert(test_compose_seq_buffer(ctx,
341 "<A> <B> : \"foo\" A \n"
342 "<A> <B> : \"bar\" A \n",
343 XKB_KEY_A, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
344 XKB_KEY_B, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "bar", XKB_KEY_A,
349 test_state(struct xkb_context *ctx)
351 struct xkb_compose_table *table;
352 struct xkb_compose_state *state;
356 path = test_get_path("compose/en_US.UTF-8/Compose");
357 file = fopen(path, "rb");
361 table = xkb_compose_table_new_from_file(ctx, file, "",
362 XKB_COMPOSE_FORMAT_TEXT_V1,
363 XKB_COMPOSE_COMPILE_NO_FLAGS);
367 state = xkb_compose_state_new(table, XKB_COMPOSE_STATE_NO_FLAGS);
370 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_NOTHING);
371 xkb_compose_state_reset(state);
372 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_NOTHING);
373 xkb_compose_state_feed(state, XKB_KEY_NoSymbol);
374 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_NOTHING);
375 xkb_compose_state_feed(state, XKB_KEY_Multi_key);
376 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_COMPOSING);
377 xkb_compose_state_reset(state);
378 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_NOTHING);
379 xkb_compose_state_feed(state, XKB_KEY_Multi_key);
380 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_COMPOSING);
381 xkb_compose_state_feed(state, XKB_KEY_Multi_key);
382 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_CANCELLED);
383 xkb_compose_state_feed(state, XKB_KEY_Multi_key);
384 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_COMPOSING);
385 xkb_compose_state_feed(state, XKB_KEY_Multi_key);
386 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_CANCELLED);
387 xkb_compose_state_reset(state);
388 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_NOTHING);
389 xkb_compose_state_feed(state, XKB_KEY_dead_acute);
390 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_COMPOSING);
391 xkb_compose_state_feed(state, XKB_KEY_A);
392 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_COMPOSED);
393 xkb_compose_state_reset(state);
394 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_NOTHING);
395 xkb_compose_state_feed(state, XKB_KEY_dead_acute);
396 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_COMPOSING);
397 xkb_compose_state_feed(state, XKB_KEY_A);
398 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_COMPOSED);
399 xkb_compose_state_reset(state);
400 xkb_compose_state_feed(state, XKB_KEY_NoSymbol);
401 assert(xkb_compose_state_get_status(state) == XKB_COMPOSE_NOTHING);
403 xkb_compose_state_unref(state);
404 xkb_compose_table_unref(table);
408 test_XCOMPOSEFILE(struct xkb_context *ctx)
410 struct xkb_compose_table *table;
413 path = test_get_path("compose/en_US.UTF-8/Compose");
414 setenv("XCOMPOSEFILE", path, 1);
417 table = xkb_compose_table_new_from_locale(ctx, "blabla",
418 XKB_COMPOSE_COMPILE_NO_FLAGS);
421 assert(test_compose_seq(table,
422 XKB_KEY_dead_tilde, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
423 XKB_KEY_space, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "~", XKB_KEY_asciitilde,
426 xkb_compose_table_unref(table);
430 test_modifier_syntax(struct xkb_context *ctx)
432 const char *table_string;
434 /* We don't do anything with the modifiers, but make sure we can parse
437 assert(test_compose_seq_buffer(ctx,
444 "Shift Ctrl <G> : Y \n"
446 "~Shift Ctrl <I> : Y \n"
447 "Shift ~Ctrl <J> : Y \n"
448 "Shift ~Ctrl ~Alt <K> : Y \n"
454 "! Shift Ctrl <G> : Y \n"
455 "! ~Shift <H> : Y \n"
456 "! ~Shift Ctrl <I> : Y \n"
457 "! Shift ~Ctrl <J> : Y \n"
458 "! Shift ~Ctrl ~Alt <K> : Y \n"
459 "<L> ! Shift <M> : Y \n"
460 "None <N> ! Shift <O> : Y \n"
461 "None <P> ! Shift <Q> : Y \n",
464 fprintf(stderr, "<START bad input string>\n");
468 "None ! Shift <C> : X \n"
472 "! Ctrl ! Ctrl <G> : X \n"
475 "None None <J> : X \n"
477 assert(!xkb_compose_table_new_from_buffer(ctx, table_string,
478 strlen(table_string), "C",
479 XKB_COMPOSE_FORMAT_TEXT_V1,
480 XKB_COMPOSE_COMPILE_NO_FLAGS));
481 fprintf(stderr, "<END bad input string>\n");
485 test_include(struct xkb_context *ctx)
487 char *path, *table_string;
489 path = test_get_path("compose/en_US.UTF-8/Compose");
492 /* We don't have a mechanism to change the include paths like we
493 * have for keymaps. So we must include the full path. */
494 table_string = asprintf_safe("<dead_tilde> <space> : \"foo\" X\n"
496 "<dead_tilde> <dead_tilde> : \"bar\" Y\n", path);
497 assert(table_string);
499 assert(test_compose_seq_buffer(ctx, table_string,
501 XKB_KEY_dead_acute, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
502 XKB_KEY_dead_acute, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "´", XKB_KEY_acute,
504 /* Comes before - doesn't override. */
505 XKB_KEY_dead_tilde, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
506 XKB_KEY_space, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "~", XKB_KEY_asciitilde,
508 /* Comes after - does override. */
509 XKB_KEY_dead_tilde, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSING, "", XKB_KEY_NoSymbol,
510 XKB_KEY_dead_tilde, XKB_COMPOSE_FEED_ACCEPTED, XKB_COMPOSE_COMPOSED, "bar", XKB_KEY_Y,
519 main(int argc, char *argv[])
521 struct xkb_context *ctx;
523 ctx = test_get_context(CONTEXT_NO_FLAG);
527 test_conflicting(ctx);
528 test_XCOMPOSEFILE(ctx);
530 test_modifier_syntax(ctx);
533 xkb_context_unref(ctx);