aboutsummaryrefslogtreecommitdiff
path: root/t/12strpkey.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2011-04-01 10:48:15 +0100
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2011-04-01 10:48:15 +0100
commita3b88040185e7bc927056475bfcc91b955d8dba5 (patch)
treeeea956114cd4991585e4e06a71bba20faf199727 /t/12strpkey.c
parent59800c356b7737213d80bec5d0b3f0df4b69284c (diff)
downloadtermo-a3b88040185e7bc927056475bfcc91b955d8dba5.tar.gz
termo-a3b88040185e7bc927056475bfcc91b955d8dba5.tar.xz
termo-a3b88040185e7bc927056475bfcc91b955d8dba5.zip
Ensure strpkey can parse numbered function keys
Diffstat (limited to 't/12strpkey.c')
-rw-r--r--t/12strpkey.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/12strpkey.c b/t/12strpkey.c
index 71c3f5d..363d6e8 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(44);
+ plan_tests(48);
tk = termkey_new(0, TERMKEY_FLAG_NOTERMIOS);
@@ -84,6 +84,13 @@ int main(int argc, char *argv[])
is_int(key.code.sym, TERMKEY_SYM_UP, "key.code.codepoint for sym/Up/0");
is_int(key.modifiers, 0, "key.modifiers for sym/Up/0");
+ CLEAR_KEY;
+ res = termkey_strpkey(tk, "F5", &key, 0);
+ is_int(res, TERMKEY_RES_KEY, "result for func/5/0");
+ is_int(key.type, TERMKEY_TYPE_FUNCTION, "key.type for func/5/0");
+ is_int(key.code.number, 5, "key.code.number for func/5/0");
+ is_int(key.modifiers, 0, "key.modifiers for func/5/0");
+
termkey_destroy(tk);
return exit_status();