mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-06 04:06:06 -05:00
test: config: verify setting an empty key/mouse binding fails
This commit is contained in:
parent
c076f03dc4
commit
454d4e22aa
1 changed files with 10 additions and 4 deletions
|
|
@ -296,7 +296,16 @@ test_key_binding(struct context *ctx, bool (*parse_fun)(struct context *ctx),
|
|||
const int click_count = action % 3 + 1;
|
||||
|
||||
/* Finally, generate the ‘value’ (e.g. “Control+shift+x”) */
|
||||
char value[128];
|
||||
char value[128] = {0};
|
||||
|
||||
ctx->key = key;
|
||||
ctx->value = value;
|
||||
|
||||
/* First, try setting the empty string */
|
||||
if (parse_fun(ctx)) {
|
||||
BUG("[%s].%s=<empty>: did not fail to parse as expected",
|
||||
ctx->section, ctx->key);
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case KEY_BINDING: {
|
||||
|
|
@ -319,9 +328,6 @@ test_key_binding(struct context *ctx, bool (*parse_fun)(struct context *ctx),
|
|||
}
|
||||
}
|
||||
|
||||
ctx->key = key;
|
||||
ctx->value = value;
|
||||
|
||||
if (!parse_fun(ctx)) {
|
||||
BUG("[%s].%s=%s failed to parse",
|
||||
ctx->section, ctx->key, ctx->value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue