diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2011-04-07 20:19:34 +0100 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2011-04-07 20:19:34 +0100 |
commit | 0a101ff71eb1133889b5f1b28b7779832eddb013 (patch) | |
tree | 08a7d3e0890b9ccd05c5966ca949fb4da275cbfd /t/12strpkey.c | |
parent | c626393aeb80b5df6ddde8ba3196d0950566190f (diff) | |
download | termo-0a101ff71eb1133889b5f1b28b7779832eddb013.tar.gz termo-0a101ff71eb1133889b5f1b28b7779832eddb013.tar.xz termo-0a101ff71eb1133889b5f1b28b7779832eddb013.zip |
Bugfix termkey_strpkey parsing unicode with trailing content
Diffstat (limited to 't/12strpkey.c')
-rw-r--r-- | t/12strpkey.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/t/12strpkey.c b/t/12strpkey.c index 43e4eb0..ef5acd9 100644 --- a/t/12strpkey.c +++ b/t/12strpkey.c @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) #define CLEAR_KEY do { key.type = -1; key.code.codepoint = -1; key.modifiers = -1; key.utf8[0] = 0; } while(0) - plan_tests(48); + plan_tests(53); tk = termkey_new(0, TERMKEY_FLAG_NOTERMIOS); @@ -22,6 +22,14 @@ int main(int argc, char *argv[]) is_str(endp, "", "consumed entire input for unicode/A/0"); CLEAR_KEY; + endp = termkey_strpkey(tk, "A and more", &key, 0); + is_int(key.type, TERMKEY_TYPE_UNICODE, "key.type for unicode/A/0 trailing"); + is_int(key.code.codepoint, 'A', "key.code.codepoint for unicode/A/0 trailing"); + is_int(key.modifiers, 0, "key.modifiers for unicode/A/0 trailing"); + is_str(key.utf8, "A", "key.utf8 for unicode/A/0 trailing"); + is_str(endp, " and more", "points at string tail for unicode/A/0 trailing"); + + CLEAR_KEY; endp = termkey_strpkey(tk, "C-b", &key, 0); is_int(key.type, TERMKEY_TYPE_UNICODE, "key.type for unicode/b/CTRL"); is_int(key.code.codepoint, 'b', "key.code.codepoint for unicode/b/CTRL"); |