diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-20 10:09:41 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-20 10:09:41 +0200 |
| commit | 5097941fa96ce0c309e5f1af034993781a70fc66 (patch) | |
| tree | ff46ced172d475046994a6c23b0cae20b693e12f /tests | |
| parent | fed4952b5e9e6bc6f9f6ca4a30570b0b898ee953 (diff) | |
| download | bokf-5097941fa96ce0c309e5f1af034993781a70fc66.tar.gz bokf-5097941fa96ce0c309e5f1af034993781a70fc66.zip | |
tui: align list rows beyond nine itemsv0.1.47
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_tui.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_tui.c b/tests/test_tui.c index a024e27..56880fa 100644 --- a/tests/test_tui.c +++ b/tests/test_tui.c @@ -32,6 +32,18 @@ static void test_disp_width(void) CHECK(tui_disp_width_n("abc", 2) == 2); } +static void test_num_width(void) +{ + CHECK(tui_num_width(0) == 1); + CHECK(tui_num_width(1) == 1); + CHECK(tui_num_width(9) == 1); + CHECK(tui_num_width(10) == 2); + CHECK(tui_num_width(16) == 2); + CHECK(tui_num_width(99) == 2); + CHECK(tui_num_width(100) == 3); + CHECK(tui_num_width(1000) == 4); +} + static void test_formats(void) { char buf[64]; @@ -667,6 +679,7 @@ static void test_rt_footer(void) int main(void) { test_disp_width(); + test_num_width(); test_formats(); test_parse_kr(); test_ledit(); |
