aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-12-26 11:37:12 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-12-26 11:37:12 +0000
commit2fa29fb5f4c0bdb986c537b547840b5d191fcdf4 (patch)
tree7e9212a998f9660b2b3c1fc6a1ce70957d4f5c48 /tests
parenttest: config: add test_double() utility function (diff)
test: config: test ‘scrollback’ section
Diffstat (limited to 'tests')
-rw-r--r--tests/test-config.c20
1 files changed, 20 insertions, 0 deletions
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
@@ -398,6 +398,25 @@ test_section_bell(void)
}
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,
struct config_key_binding_list *bindings,
@@ -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();