aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-11-30 14:37:28 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-11-30 14:37:28 +0000
commit26912d989b88741cb581ce1d261b096172260886 (patch)
tree652b476ce69e651d50dfb0a94e0c03e3189b3bd5 /t
parent7b3dc4be71e9c611bc4a6b191264f99eb642d44c (diff)
downloadtermo-26912d989b88741cb581ce1d261b096172260886.tar.gz
termo-26912d989b88741cb581ce1d261b096172260886.tar.xz
termo-26912d989b88741cb581ce1d261b096172260886.zip
Unit test that CSI initial command also works
Diffstat (limited to 't')
-rw-r--r--t/39csi.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/t/39csi.c b/t/39csi.c
index f3bb598..fa9d4a0 100644
--- a/t/39csi.c
+++ b/t/39csi.c
@@ -9,13 +9,13 @@ int main(int argc, char *argv[])
size_t nargs = 16;
unsigned long command;
- plan_tests(7);
+ plan_tests(11);
tk = termkey_new_abstract("vt100", 0);
termkey_push_bytes(tk, "\e[5;25v", 7);
- is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY for position report");
+ is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY for CSI v");
is_int(key.type, TERMKEY_TYPE_UNKNOWN_CSI, "key.type for unknown CSI");
@@ -26,6 +26,13 @@ int main(int argc, char *argv[])
is_int(args[1], 25, "args[1] for unknown CSI");
is_int(command, 'v', "command for unknown CSI");
+ termkey_push_bytes(tk, "\e[?w", 4);
+
+ is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY for CSI ? w");
+ is_int(key.type, TERMKEY_TYPE_UNKNOWN_CSI, "key.type for unknown CSI");
+ is_int(termkey_interpret_csi(tk, &key, args, &nargs, &command), TERMKEY_RES_KEY, "interpret_csi yields RES_KEY");
+ is_int(command, '?' << 8 | 'w', "command for unknown CSI");
+
termkey_destroy(tk);
return exit_status();