aboutsummaryrefslogtreecommitdiff
path: root/t/10keyname.c
blob: 0e691221a135bb0f1fcd76bc96bd5e911e9ad59c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "../termkey.h"
#include "taplib.h"

int main(int argc, char *argv[])
{
  TermKey   *tk;
  TermKeySym sym;

  plan_tests(3);

  tk = termkey_new(0, TERMKEY_FLAG_NOTERMIOS);

  sym = termkey_keyname2sym(tk, "Space");
  is_int(sym, TERMKEY_SYM_SPACE, "keyname2sym Space");

  sym = termkey_keyname2sym(tk, "SomeUnknownKey");
  is_int(sym, TERMKEY_SYM_UNKNOWN, "keyname2sym SomeUnknownKey");

  is_str(termkey_get_keyname(tk, TERMKEY_SYM_SPACE), "Space", "get_keyname SPACE");

  termkey_destroy(tk);

  return exit_status();
}