aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-12-25 22:03:11 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-12-25 22:03:11 +0000
commitba851c963e5b3b8645b38c7172d898d2ab576def (patch)
treeeda837b6416ee7d337225d4017aa2d6df70a3fda /tests
parentchangelog: grammar (diff)
test: config: ‘bell’ section
Diffstat (limited to 'tests')
-rw-r--r--tests/test-config.c19
1 files changed, 19 insertions, 0 deletions
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
@@ -263,6 +263,24 @@ test_section_main(void)
}
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,
struct config_key_binding_list *bindings,
@@ -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();