From 2fa29fb5f4c0bdb986c537b547840b5d191fcdf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 26 Dec 2021 12:37:12 +0100 Subject: [PATCH] =?UTF-8?q?test:=20config:=20test=20=E2=80=98scrollback?= =?UTF-8?q?=E2=80=99=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test-config.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test-config.c b/tests/test-config.c index 2ba2795b..9bd38cb6 100644 --- a/tests/test-config.c +++ b/tests/test-config.c @@ -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();