]> git.ipfire.org Git - thirdparty/git.git/commit
t/unit-tests: add UTF-8 width tests for CJK chars
authorJiang Xin <worldhello.net@gmail.com>
Sat, 15 Nov 2025 13:36:10 +0000 (08:36 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Nov 2025 00:04:24 +0000 (16:04 -0800)
commit878fef8ebf6cf513842de14284ee58f4d92fcef3
tree418f3dbe468f9c7e46f9202dad9c7552dab5a738
parentfd372d9b1a69a01a676398882bbe3840bf51fe72
t/unit-tests: add UTF-8 width tests for CJK chars

The file "builtin/repo.c" uses utf8_strwidth() to calculate the display
width of UTF-8 characters in a table, but the resulting output is still
misaligned. Add test cases for both utf8_strwidth and utf8_strnwidth to
verify that they correctly compute the display width for UTF-8
characters.

Also updated the build configuration in Makefile and meson.build to
include the new test suite in the build process.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
t/meson.build
t/unit-tests/u-utf8-width.c [new file with mode: 0644]