diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-12-29 18:10:49 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-12-29 18:18:40 +0000 |
| commit | 58ce3b4a17bee7fa92feb89874b79168ae836219 (patch) | |
| tree | 222ec40138b45a769c489ed54a3cd99a18d6b088 | |
| parent | test: config: rename ‘conf_ptr’ -> ‘ptr’ (diff) | |
test: config: test URL section
| -rw-r--r-- | tests/test-config.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test-config.c b/tests/test-config.c index d14a28ee..bac040b5 100644 --- a/tests/test-config.c +++ b/tests/test-config.c @@ -476,6 +476,29 @@ test_section_scrollback(void) } static void +test_section_url(void) +{ + struct config conf = {0}; + struct context ctx = { + .conf = &conf, .section = "url", .path = "unittest"}; + + test_invalid_key(&ctx, &parse_section_url, "invalid-key"); + + test_spawn_template(&ctx, &parse_section_url, "launch", &conf.url.launch); + test_enum(&ctx, &parse_section_url, "osc8-underline", + 2, + (const char *[]){"url-mode", "always"}, + (int []){OSC8_UNDERLINE_URL_MODE, OSC8_UNDERLINE_ALWAYS}, + (int *)&conf.url.osc8_underline); + test_wstring(&ctx, &parse_section_url, "label-letters", &conf.url.label_letters); + + /* TODO: protocols (list of wchars) */ + /* TODO: uri-characters (wchar string, but sorted) */ + + 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, @@ -901,6 +924,7 @@ main(int argc, const char *const *argv) test_section_main(); test_section_bell(); test_section_scrollback(); + test_section_url(); test_section_key_bindings(); test_section_key_bindings_collisions(); test_section_search_bindings(); |
