From ba851c963e5b3b8645b38c7172d898d2ab576def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 25 Dec 2021 23:03:11 +0100 Subject: [PATCH] =?UTF-8?q?test:=20config:=20=E2=80=98bell=E2=80=99=20sect?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test-config.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/test-config.c b/tests/test-config.c index 6a2edcb8..4e0bea87 100644 --- a/tests/test-config.c +++ b/tests/test-config.c @@ -262,6 +262,24 @@ test_section_main(void) config_free(conf); } +static void +test_section_bell(void) +{ + struct config conf = {0}; + struct context ctx = {.conf = &conf, .section = "bell", .path = "unittest"}; + + test_invalid_key(&ctx, &parse_section_bell, "invalid-key"); + + test_boolean(&ctx, &parse_section_bell, "urgent", &conf.bell.urgent); + test_boolean(&ctx, &parse_section_bell, "notify", &conf.bell.notify); + test_boolean(&ctx, &parse_section_bell, "command-focused", + &conf.bell.command_focused); + + /* TODO: command (spawn tepmlate) */ + + 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, @@ -650,6 +668,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_key_bindings(); test_section_key_bindings_collisions(); test_section_search_bindings();