2011-08-27 20:29:34 +02:00
|
|
|
#include <stdio.h>
|
2014-10-14 00:24:47 +02:00
|
|
|
#include "../termo.h"
|
2011-08-27 20:29:34 +02:00
|
|
|
#include "taplib.h"
|
|
|
|
|
2014-09-28 05:56:13 +02:00
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
2011-08-27 20:29:34 +02:00
|
|
|
{
|
2014-10-14 00:24:47 +02:00
|
|
|
termo_t *tk;
|
|
|
|
termo_key_t key;
|
2011-08-27 20:29:34 +02:00
|
|
|
|
2014-09-28 05:56:13 +02:00
|
|
|
plan_tests (8);
|
2011-08-27 20:29:34 +02:00
|
|
|
|
2014-10-14 00:24:47 +02:00
|
|
|
tk = termo_new_abstract ("vt100", NULL, 0);
|
2011-08-27 20:29:34 +02:00
|
|
|
|
2014-10-14 00:24:47 +02:00
|
|
|
termo_push_bytes (tk, " ", 1);
|
2011-08-27 20:29:34 +02:00
|
|
|
|
2014-10-14 00:24:47 +02:00
|
|
|
is_int (termo_getkey (tk, &key), TERMO_RES_KEY,
|
2014-09-28 05:56:13 +02:00
|
|
|
"getkey yields RES_KEY after space");
|
2011-08-27 20:29:34 +02:00
|
|
|
|
2014-10-14 00:24:47 +02:00
|
|
|
is_int (key.type, TERMO_TYPE_KEY, "key.type after space");
|
2014-09-28 05:56:13 +02:00
|
|
|
is_int (key.code.codepoint, ' ', "key.code.codepoint after space");
|
|
|
|
is_int (key.modifiers, 0, "key.modifiers after space");
|
2011-08-27 20:29:34 +02:00
|
|
|
|
2014-10-14 00:24:47 +02:00
|
|
|
termo_set_flags (tk, TERMO_FLAG_SPACESYMBOL);
|
2011-08-27 20:29:34 +02:00
|
|
|
|
2014-10-14 00:24:47 +02:00
|
|
|
termo_push_bytes (tk, " ", 1);
|
2011-08-27 20:29:34 +02:00
|
|
|
|
2014-10-14 00:24:47 +02:00
|
|
|
is_int (termo_getkey (tk, &key), TERMO_RES_KEY,
|
2014-09-28 05:56:13 +02:00
|
|
|
"getkey yields RES_KEY after space");
|
2011-08-27 20:29:34 +02:00
|
|
|
|
2014-10-14 00:24:47 +02:00
|
|
|
is_int (key.type, TERMO_TYPE_KEYSYM,
|
2014-09-28 05:56:13 +02:00
|
|
|
"key.type after space with FLAG_SPACESYMBOL");
|
2014-10-14 00:24:47 +02:00
|
|
|
is_int (key.code.sym, TERMO_SYM_SPACE,
|
2014-09-28 05:56:13 +02:00
|
|
|
"key.code.sym after space with FLAG_SPACESYMBOL");
|
|
|
|
is_int (key.modifiers, 0,
|
|
|
|
"key.modifiers after space with FLAG_SPACESYMBOL");
|
2011-08-27 20:29:34 +02:00
|
|
|
|
2014-10-14 00:24:47 +02:00
|
|
|
termo_destroy (tk);
|
2014-09-28 05:56:13 +02:00
|
|
|
return exit_status ();
|
2011-08-27 20:29:34 +02:00
|
|
|
}
|