mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-13 04:27:47 -05:00
test: config: test cursor section
This commit is contained in:
parent
58ce3b4a17
commit
956f8995b9
1 changed files with 27 additions and 0 deletions
|
|
@ -498,6 +498,32 @@ test_section_url(void)
|
|||
config_free(conf);
|
||||
}
|
||||
|
||||
static void
|
||||
test_section_cursor(void)
|
||||
{
|
||||
struct config conf = {0};
|
||||
struct context ctx = {
|
||||
.conf = &conf, .section = "cursor", .path = "unittest"};
|
||||
|
||||
test_invalid_key(&ctx, &parse_section_cursor, "invalid-key");
|
||||
|
||||
test_enum(
|
||||
&ctx, &parse_section_cursor, "style",
|
||||
3,
|
||||
(const char *[]){"block", "beam", "underline"},
|
||||
(int []){CURSOR_BLOCK, CURSOR_BEAM, CURSOR_UNDERLINE},
|
||||
(int *)&conf.cursor.style);
|
||||
test_boolean(&ctx, &parse_section_cursor, "blink", &conf.cursor.blink);
|
||||
test_pt_or_px(&ctx, &parse_section_cursor, "beam-thickness",
|
||||
&conf.cursor.beam_thickness);
|
||||
test_pt_or_px(&ctx, &parse_section_cursor, "underline-thickness",
|
||||
&conf.cursor.underline_thickness);
|
||||
|
||||
/* TODO: color (two RRGGBB values) */
|
||||
|
||||
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,
|
||||
|
|
@ -925,6 +951,7 @@ main(int argc, const char *const *argv)
|
|||
test_section_bell();
|
||||
test_section_scrollback();
|
||||
test_section_url();
|
||||
test_section_cursor();
|
||||
test_section_key_bindings();
|
||||
test_section_key_bindings_collisions();
|
||||
test_section_search_bindings();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue