mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
vt: add some unit tests for action_collect()
This commit is contained in:
parent
4e8db9d8b6
commit
b18d3aef17
1 changed files with 23 additions and 0 deletions
23
vt.c
23
vt.c
|
|
@ -412,6 +412,29 @@ action_collect(struct terminal *term, uint8_t c)
|
||||||
LOG_WARN("only four private/intermediate characters supported");
|
LOG_WARN("only four private/intermediate characters supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UNITTEST
|
||||||
|
{
|
||||||
|
struct terminal term = {.vt = {.private = 0}};
|
||||||
|
uint32_t expected = ' ';
|
||||||
|
action_collect(&term, ' ');
|
||||||
|
xassert(term.vt.private == expected);
|
||||||
|
|
||||||
|
expected |= '/' << 8;
|
||||||
|
action_collect(&term, '/');
|
||||||
|
xassert(term.vt.private == expected);
|
||||||
|
|
||||||
|
expected |= '<' << 16;
|
||||||
|
action_collect(&term, '<');
|
||||||
|
xassert(term.vt.private == expected);
|
||||||
|
|
||||||
|
expected |= '?' << 24;
|
||||||
|
action_collect(&term, '?');
|
||||||
|
xassert(term.vt.private == expected);
|
||||||
|
|
||||||
|
action_collect(&term, '?');
|
||||||
|
xassert(term.vt.private == expected);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
action_esc_dispatch(struct terminal *term, uint8_t final)
|
action_esc_dispatch(struct terminal *term, uint8_t final)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue