Re: [PATCH 2/2] builtin/repo: fix table alignment for UTF-8 characters
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 15, 2025, 16:36 UTC
- Message-ID
- <xmqqtsyvfe2f.fsf@gitster.g>
- In-Reply-To
- <CANYiYbEFN9BHtNh1PQ9C3gDJasq1PaKnkcH-Nq=FddUCAcMGqg@mail.gmail.com>
Jiang Xin <worldhello.net@gmail.com> writes:
Show 8 quoted lines
>> > builtin/repo.c | 22 ++++++++++++++++++---- >> > 1 file changed, 18 insertions(+), 4 deletions(-) >> >> ... it is a good idea to protect the change with a new test or two >> to make sure the expected alignment in the output. > > Will add test cases for strbuf_utf8_align(), a function newly > introduced in builtin/repo.c.
Unit tests are nice to make sure that building blocks like this helper function works as expected. To ensure that the application uses the building blocks correctly, you'd also need end-to-end test, getting output out of the tool ("repo struct"?) and checking it.