diff options
Diffstat (limited to 't')
-rw-r--r-- | t/13cmpkey.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/t/13cmpkey.c b/t/13cmpkey.c index 90ff9e1..62902cc 100644 --- a/t/13cmpkey.c +++ b/t/13cmpkey.c @@ -6,7 +6,7 @@ int main(int argc, char *argv[]) TermKey *tk; TermKeyKey key1, key2; - plan_tests(10); + plan_tests(12); tk = termkey_new(0, TERMKEY_FLAG_NOTERMIOS); @@ -44,6 +44,18 @@ int main(int argc, char *argv[]) ok(termkey_keycmp(tk, &key1, &key2) < 0, "cmpkey orders KEYSYM after UNICODE"); ok(termkey_keycmp(tk, &key2, &key1) > 0, "cmpkey orders UNICODE before KEYSYM"); + key1.type = TERMKEY_TYPE_KEYSYM; + key1.code.sym = TERMKEY_SYM_SPACE; + key1.modifiers = 0; + key2.type = TERMKEY_TYPE_UNICODE; + key2.code.codepoint = ' '; + key2.modifiers = 0; + + is_int(termkey_keycmp(tk, &key1, &key2), 0, "cmpkey considers KEYSYM/SPACE and UNICODE/SP identical"); + + termkey_set_canonflags(tk, termkey_get_canonflags(tk) | TERMKEY_CANON_SPACESYMBOL); + is_int(termkey_keycmp(tk, &key1, &key2), 0, "cmpkey considers KEYSYM/SPACE and UNICODE/SP identical under SPACESYMBOL"); + termkey_destroy(tk); return exit_status(); |