From 54490a29006529f7ceb4dc0514a075f9f4175621 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 20 Mar 2024 16:56:46 -0400 Subject: bfstd: Check that wcwidth() is positive wcwidth() returns -1 for non-printable characters, but terminals typically don't print anything for them, so treat them as 0. --- tests/bfstd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/bfstd.c b/tests/bfstd.c index 26abdb6..1351e11 100644 --- a/tests/bfstd.c +++ b/tests/bfstd.c @@ -69,5 +69,8 @@ bool check_bfstd(void) { ret &= check_wordesc("\xF0\x9F\x98\x80", "\xF0\x9F\x98\x80", WESC_SHELL | WESC_TTY); } + ret &= bfs_check(xstrwidth("Hello world") == 11); + ret &= bfs_check(xstrwidth("Hello\1world") == 10); + return ret; } -- cgit v1.2.3