aboutsummaryrefslogtreecommitdiff
path: root/t/39csi.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-09-28 05:56:13 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-09-28 13:03:04 +0200
commit3465d5553fbe88a75320d1da3f7228619492b036 (patch)
treeb2086113248a918c8863dadb58a5736a2be75583 /t/39csi.c
parent36bc6cd0952b2eddc17e7da803d85decf96d32cc (diff)
downloadtermo-3465d5553fbe88a75320d1da3f7228619492b036.tar.gz
termo-3465d5553fbe88a75320d1da3f7228619492b036.tar.xz
termo-3465d5553fbe88a75320d1da3f7228619492b036.zip
Make the tests work again
Our UTF-8 parsing now behaves differently, though.
Diffstat (limited to 't/39csi.c')
-rw-r--r--t/39csi.c64
1 files changed, 35 insertions, 29 deletions
diff --git a/t/39csi.c b/t/39csi.c
index 9d186f6..32a15b0 100644
--- a/t/39csi.c
+++ b/t/39csi.c
@@ -1,46 +1,52 @@
#include "../termkey.h"
#include "taplib.h"
-int main(int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
- TermKey *tk;
- TermKeyKey key;
- long args[16];
- size_t nargs = 16;
- unsigned long command;
+ termkey_t *tk;
+ termkey_key_t key;
+ long args[16];
+ size_t nargs = 16;
+ unsigned long command;
- plan_tests(15);
+ plan_tests (15);
- tk = termkey_new_abstract("vt100", 0);
+ tk = termkey_new_abstract ("vt100", NULL, 0);
- termkey_push_bytes(tk, "\e[5;25v", 7);
+ termkey_push_bytes (tk, "\e[5;25v", 7);
- is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY for CSI v");
+ 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");
+ 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 (termkey_interpret_csi (tk, &key, args, &nargs, &command),
+ TERMKEY_RES_KEY, "interpret_csi yields RES_KEY");
- is_int(nargs, 2, "nargs for unknown CSI");
- is_int(args[0], 5, "args[0] for unknown CSI");
- is_int(args[1], 25, "args[1] for unknown CSI");
- is_int(command, 'v', "command for unknown CSI");
+ is_int (nargs, 2, "nargs for unknown CSI");
+ is_int (args[0], 5, "args[0] for unknown CSI");
+ 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);
+ 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");
+ 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_push_bytes(tk, "\e[?$x", 5);
+ termkey_push_bytes (tk, "\e[?$x", 5);
- is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY for CSI ? $x");
- 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, '$'<<16 | '?'<<8 | 'x', "command for unknown CSI");
+ is_int (termkey_getkey (tk, &key), TERMKEY_RES_KEY,
+ "getkey yields RES_KEY for CSI ? $x");
+ 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, ('$' << 16) | ('?' << 8) | 'x', "command for unknown CSI");
- termkey_destroy(tk);
-
- return exit_status();
+ termkey_destroy (tk);
+ return exit_status ();
}