aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2011-03-31 13:43:16 +0100
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2011-03-31 13:43:16 +0100
commitf230bc86fbb68d3f37586e2f9a428a16e54d57f4 (patch)
tree2077bc50ddb2223531325882d99870d64d782986
parent1bf3c958b13d70e495299238f0e178f8f99ced67 (diff)
downloadtermo-f230bc86fbb68d3f37586e2f9a428a16e54d57f4.tar.gz
termo-f230bc86fbb68d3f37586e2f9a428a16e54d57f4.tar.xz
termo-f230bc86fbb68d3f37586e2f9a428a16e54d57f4.zip
Added some unit tests for keyname <=> sym constant conversions
-rw-r--r--t/10keyname.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/10keyname.c b/t/10keyname.c
new file mode 100644
index 0000000..1c0b921
--- /dev/null
+++ b/t/10keyname.c
@@ -0,0 +1,24 @@
+#include "termkey.h"
+#include "taplib.h"
+
+int main(int argc, char *argv[])
+{
+ TermKey *tk;
+ TermKeySym sym;
+
+ plan_tests(3);
+
+ tk = termkey_new(0, TERMKEY_FLAG_NOTERMIOS);
+
+ sym = termkey_keyname2sym(tk, "Space");
+ is_int(sym, TERMKEY_SYM_SPACE, "keyname2sym Space");
+
+ sym = termkey_keyname2sym(tk, "SomeUnknownKey");
+ is_int(sym, TERMKEY_SYM_UNKNOWN, "keyname2sym SomeUnknownKey");
+
+ is_str(termkey_get_keyname(tk, TERMKEY_SYM_SPACE), "Space", "get_keyname SPACE");
+
+ termkey_destroy(tk);
+
+ return exit_status();
+}