From a36648e1721367e3e423be7a567aeeafc25e3f54 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Mon, 26 Aug 2013 01:14:35 +0100 Subject: Added TERMKEY_FORMAT_LOWERMOD --- t/11strfkey.c | 12 +++++++++++- t/12strpkey.c | 12 ++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 't') diff --git a/t/11strfkey.c b/t/11strfkey.c index 20d822f..3125553 100644 --- a/t/11strfkey.c +++ b/t/11strfkey.c @@ -8,7 +8,7 @@ int main(int argc, char *argv[]) char buffer[16]; size_t len; - plan_tests(32); + plan_tests(36); tk = termkey_new_abstract("vt100", 0); @@ -43,6 +43,16 @@ int main(int argc, char *argv[]) is_int(len, 6, "length for unicode/b/CTRL longmod|spacemod"); is_str(buffer, "Ctrl b", "buffer for unicode/b/CTRL longmod|spacemod"); + len = termkey_strfkey(tk, buffer, sizeof buffer, &key, + TERMKEY_FORMAT_LONGMOD|TERMKEY_FORMAT_LOWERMOD); + is_int(len, 6, "length for unicode/b/CTRL longmod|lowermod"); + is_str(buffer, "ctrl-b", "buffer for unicode/b/CTRL longmod|lowermod"); + + len = termkey_strfkey(tk, buffer, sizeof buffer, &key, + TERMKEY_FORMAT_LONGMOD|TERMKEY_FORMAT_SPACEMOD|TERMKEY_FORMAT_LOWERMOD); + is_int(len, 6, "length for unicode/b/CTRL longmod|spacemod|lowermode"); + is_str(buffer, "ctrl b", "buffer for unicode/b/CTRL longmod|spacemod|lowermode"); + len = termkey_strfkey(tk, buffer, sizeof buffer, &key, TERMKEY_FORMAT_CARETCTRL); is_int(len, 2, "length for unicode/b/CTRL caretctrl"); is_str(buffer, "^B", "buffer for unicode/b/CTRL caretctrl"); diff --git a/t/12strpkey.c b/t/12strpkey.c index 9f20883..099fe9a 100644 --- a/t/12strpkey.c +++ b/t/12strpkey.c @@ -86,12 +86,12 @@ int main(int argc, char *argv[]) is_str(endp, "", "consumed entire input for unicode/c/ALT altismeta+longmod"); CLEAR_KEY; - endp = termkey_strpkey(tk, "Meta c", &key, TERMKEY_FORMAT_ALTISMETA|TERMKEY_FORMAT_LONGMOD|TERMKEY_FORMAT_SPACEMOD); - is_int(key.type, TERMKEY_TYPE_UNICODE, "key.type for unicode/c/ALT altismeta+long/lowermod"); - is_int(key.code.codepoint, 'c', "key.code.codepoint for unicode/c/ALT altismeta+long/lowermod"); - is_int(key.modifiers, TERMKEY_KEYMOD_ALT, "key.modifiers for unicode/c/ALT altismeta+long/lowermod"); - is_str(key.utf8, "c", "key.utf8 for unicode/c/ALT altismeta+long/lowermod"); - is_str(endp, "", "consumed entire input for unicode/c/ALT altismeta+longmod"); + endp = termkey_strpkey(tk, "meta c", &key, TERMKEY_FORMAT_ALTISMETA|TERMKEY_FORMAT_LONGMOD|TERMKEY_FORMAT_SPACEMOD|TERMKEY_FORMAT_LOWERMOD); + is_int(key.type, TERMKEY_TYPE_UNICODE, "key.type for unicode/c/ALT altismeta+long/space+lowermod"); + is_int(key.code.codepoint, 'c', "key.code.codepoint for unicode/c/ALT altismeta+long/space+lowermod"); + is_int(key.modifiers, TERMKEY_KEYMOD_ALT, "key.modifiers for unicode/c/ALT altismeta+long/space+lowermod"); + is_str(key.utf8, "c", "key.utf8 for unicode/c/ALT altismeta+long/space_lowermod"); + is_str(endp, "", "consumed entire input for unicode/c/ALT altismeta+long/space+lowermod"); CLEAR_KEY; endp = termkey_strpkey(tk, "Up", &key, 0); -- cgit v1.2.3-70-g09d2