aboutsummaryrefslogtreecommitdiff
path: root/t/31position.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/31position.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/31position.c')
-rw-r--r--t/31position.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/t/31position.c b/t/31position.c
index 1748211..a62be7a 100644
--- a/t/31position.c
+++ b/t/31position.c
@@ -1,38 +1,38 @@
#include "../termkey.h"
#include "taplib.h"
-int main(int argc, char *argv[])
+int main (int argc, char *argv[])
{
- TermKey *tk;
- TermKeyKey key;
- int line, col;
+ termkey_t *tk;
+ termkey_key_t key;
+ int line, col;
- plan_tests(8);
+ plan_tests (8);
- tk = termkey_new_abstract("vt100", 0);
+ tk = termkey_new_abstract ("vt100", NULL, 0);
- termkey_push_bytes(tk, "\e[?15;7R", 8);
+ termkey_push_bytes (tk, "\e[?15;7R", 8);
- 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 position report");
- is_int(key.type, TERMKEY_TYPE_POSITION, "key.type for position report");
+ is_int (key.type, TERMKEY_TYPE_POSITION, "key.type for position report");
- is_int(termkey_interpret_position(tk, &key, &line, &col), TERMKEY_RES_KEY, "interpret_position yields RES_KEY");
+ is_int (termkey_interpret_position (tk, &key, &line, &col), TERMKEY_RES_KEY,
+ "interpret_position yields RES_KEY");
- is_int(line, 15, "line for position report");
- is_int(col, 7, "column for position report");
+ is_int (line, 15, "line for position report");
+ is_int (col, 7, "column for position report");
- /* A plain CSI R is likely to be <F3> though.
- * This is tricky :/
- */
- termkey_push_bytes(tk, "\e[R", 3);
+ /* A plain CSI R is likely to be <F3> though. This is tricky :/ */
+ termkey_push_bytes (tk, "\e[R", 3);
- is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY for <F3>");
+ is_int (termkey_getkey (tk, &key), TERMKEY_RES_KEY,
+ "getkey yields RES_KEY for <F3>");
- is_int(key.type, TERMKEY_TYPE_FUNCTION, "key.type for <F3>");
- is_int(key.code.number, 3, "key.code.number for <F3>");
+ is_int (key.type, TERMKEY_TYPE_FUNCTION, "key.type for <F3>");
+ is_int (key.code.number, 3, "key.code.number for <F3>");
- termkey_destroy(tk);
-
- return exit_status();
+ termkey_destroy (tk);
+ return exit_status ();
}