Use termkey_new_abstract() in unit tests

This commit is contained in:
Paul LeoNerd Evans 2012-01-26 12:55:34 +00:00
parent ea2d3073ac
commit 50327ce6dc
9 changed files with 10 additions and 20 deletions

View File

@ -8,9 +8,9 @@ int main(int argc, char *argv[])
plan_tests(2); plan_tests(2);
tk = termkey_new(-1, 0); tk = termkey_new_abstract("vt100", 0);
ok(!!tk, "termkey_new"); ok(!!tk, "termkey_new_abstract");
termkey_destroy(tk); termkey_destroy(tk);

View File

@ -1,4 +1,3 @@
#include <stdio.h>
#include "../termkey.h" #include "../termkey.h"
#include "taplib.h" #include "taplib.h"
@ -9,10 +8,7 @@ int main(int argc, char *argv[])
plan_tests(27); plan_tests(27);
/* Sanitise this just in case */ tk = termkey_new_abstract("vt100", 0);
putenv("TERM=vt100");
tk = termkey_new(-1, 0);
is_int(termkey_get_buffer_remaining(tk), 256, "buffer free initially 256"); is_int(termkey_get_buffer_remaining(tk), 256, "buffer free initially 256");

View File

@ -8,10 +8,7 @@ int main(int argc, char *argv[])
plan_tests(57); plan_tests(57);
/* Sanitise this just in case */ tk = termkey_new_abstract("vt100", TERMKEY_FLAG_UTF8);
putenv("TERM=vt100");
tk = termkey_new(-1, TERMKEY_FLAG_UTF8);
termkey_push_bytes(tk, "a", 1); termkey_push_bytes(tk, "a", 1);

View File

@ -9,10 +9,7 @@ int main(int argc, char *argv[])
plan_tests(8); plan_tests(8);
/* Sanitise this just in case */ tk = termkey_new_abstract("vt100", 0);
putenv("TERM=vt100");
tk = termkey_new(-1, 0);
termkey_push_bytes(tk, " ", 1); termkey_push_bytes(tk, " ", 1);

View File

@ -9,7 +9,7 @@ int main(int argc, char *argv[])
plan_tests(10); plan_tests(10);
tk = termkey_new(-1, 0); tk = termkey_new_abstract("vt100", 0);
sym = termkey_keyname2sym(tk, "Space"); sym = termkey_keyname2sym(tk, "Space");
is_int(sym, TERMKEY_SYM_SPACE, "keyname2sym Space"); is_int(sym, TERMKEY_SYM_SPACE, "keyname2sym Space");

View File

@ -10,7 +10,7 @@ int main(int argc, char *argv[])
plan_tests(28); plan_tests(28);
tk = termkey_new(-1, 0); tk = termkey_new_abstract("vt100", 0);
key.type = TERMKEY_TYPE_UNICODE; key.type = TERMKEY_TYPE_UNICODE;
key.code.codepoint = 'A'; key.code.codepoint = 'A';

View File

@ -11,7 +11,7 @@ int main(int argc, char *argv[])
plan_tests(53); plan_tests(53);
tk = termkey_new(-1, 0); tk = termkey_new_abstract("vt100", 0);
CLEAR_KEY; CLEAR_KEY;
endp = termkey_strpkey(tk, "A", &key, 0); endp = termkey_strpkey(tk, "A", &key, 0);

View File

@ -8,7 +8,7 @@ int main(int argc, char *argv[])
plan_tests(12); plan_tests(12);
tk = termkey_new(-1, 0); tk = termkey_new_abstract("vt100", 0);
key1.type = TERMKEY_TYPE_UNICODE; key1.type = TERMKEY_TYPE_UNICODE;
key1.code.codepoint = 'A'; key1.code.codepoint = 'A';

View File

@ -11,7 +11,7 @@ int main(int argc, char *argv[])
plan_tests(26); plan_tests(26);
tk = termkey_new(-1, 0); tk = termkey_new_abstract("vt100", 0);
CLEAR_KEY; CLEAR_KEY;
endp = termkey_strpkey(tk, " ", &key, 0); endp = termkey_strpkey(tk, " ", &key, 0);