aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-07-24 00:41:49 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-07-24 00:41:49 +0200
commit9ec09b90c9bb023bb69a6b703ce4df40d397f5e6 (patch)
tree1ebb4d9759e3307eeba0f7c2b7c245d905d751bf /tests
parent9b7c801c370b69bec13b7d737212cab3d70b0f11 (diff)
downloadtermo-9ec09b90c9bb023bb69a6b703ce4df40d397f5e6.tar.gz
termo-9ec09b90c9bb023bb69a6b703ce4df40d397f5e6.tar.xz
termo-9ec09b90c9bb023bb69a6b703ce4df40d397f5e6.zip
Make ASCII NUL imply Ctrl-Space instead of C-@
Seems mostly arbitrary.
Diffstat (limited to 'tests')
-rw-r--r--tests/02getkey.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/02getkey.c b/tests/02getkey.c
index b36eb9e..a5443e2 100644
--- a/tests/02getkey.c
+++ b/tests/02getkey.c
@@ -7,7 +7,7 @@ main (int argc, char *argv[])
termo_t *tk;
termo_key_t key;
- plan_tests (38);
+ plan_tests (42);
tk = termo_new_abstract ("vt100", NULL, 0);
@@ -86,6 +86,15 @@ main (int argc, char *argv[])
is_int (key.modifiers, TERMO_KEYMOD_CTRL,
"key.modifiers after Ctrl-Escape");
+ termo_push_bytes (tk, "\0", 1);
+
+ is_int (termo_getkey (tk, &key), TERMO_RES_KEY,
+ "getkey yields RES_KEY after Ctrl-Space");
+
+ is_int (key.type, TERMO_TYPE_KEY, "key.type after Ctrl-Space");
+ is_int (key.code.codepoint, ' ', "key.code.codepoint after Ctrl-Space");
+ is_int (key.modifiers, TERMO_KEYMOD_CTRL, "key.modifiers after Ctrl-Space");
+
// Escape key in various amounts
termo_push_bytes (tk, "\x1b\x1b", 2);