aboutsummaryrefslogtreecommitdiff
path: root/t/11strfkey.c
diff options
context:
space:
mode:
Diffstat (limited to 't/11strfkey.c')
-rw-r--r--t/11strfkey.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/11strfkey.c b/t/11strfkey.c
index d271ead..36c923e 100644
--- a/t/11strfkey.c
+++ b/t/11strfkey.c
@@ -8,7 +8,7 @@ int main(int argc, char *argv[])
char buffer[16];
size_t len;
- plan_tests(40);
+ plan_tests(44);
tk = termkey_new_abstract("vt100", 0);
@@ -106,6 +106,15 @@ int main(int argc, char *argv[])
is_int(len, 7, "length for sym/PageUp/0 lowerspace");
is_str(buffer, "page up", "buffer for sym/PageUp/0 lowerspace");
+ /* If size of buffer is too small, strfkey should return something consistent */
+ len = termkey_strfkey(tk, buffer, 4, &key, 0);
+ is_int(len, 6, "length for sym/PageUp/0");
+ is_str(buffer, "Pag", "buffer of len 4 for sym/PageUp/0");
+
+ len = termkey_strfkey(tk, buffer, 4, &key, TERMKEY_FORMAT_LOWERSPACE);
+ is_int(len, 7, "length for sym/PageUp/0 lowerspace");
+ is_str(buffer, "pag", "buffer of len 4 for sym/PageUp/0 lowerspace");
+
key.type = TERMKEY_TYPE_FUNCTION;
key.code.number = 5;
key.modifiers = 0;