test: config: test ‘scrollback’ section

This commit is contained in:
Daniel Eklöf 2021-12-26 12:37:12 +01:00
parent cd9b936003
commit 2fa29fb5f4
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -397,6 +397,25 @@ test_section_bell(void)
config_free(conf);
}
static void
test_section_scrollback(void)
{
struct config conf = {0};
struct context ctx = {
.conf = &conf, .section = "scrollback", .path = "unittest"};
test_invalid_key(&ctx, &parse_section_scrollback, "invalid-key");
test_uint32(&ctx, &parse_section_scrollback, "lines",
&conf.scrollback.lines);
test_double(&ctx, parse_section_scrollback, "multiplier", &conf.scrollback.multiplier);
/* TODO: indicator-position (enum) */
/* TODO: indicator-format (enum, sort-of) */
config_free(conf);
}
static void
test_key_binding(struct context *ctx, bool (*parse_fun)(struct context *ctx),
int action, int max_action, const char *const *map,
@ -822,6 +841,7 @@ main(int argc, const char *const *argv)
log_init(LOG_COLORIZE_AUTO, false, 0, LOG_CLASS_ERROR);
test_section_main();
test_section_bell();
test_section_scrollback();
test_section_key_bindings();
test_section_key_bindings_collisions();
test_section_search_bindings();