t7810: turn MB_REGEX check into a lazy prereq

In t7810 we verify whether the system has proper multibyte locale support by executing `test-tool regex` with a unicode character. When this check fails though we'll output an error that breaks the TAP format. Fix this issue by turning the logic into a lazy prerequisite. Reported-by: Jeff King <peff@peff.net> Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Jun 4, 2026 at 12:07 UTC b1688db759de18a8403945090688b8cc25ba26dd
1 file changed +3 -2
t/t7810-grep.sh
+3 -2
@@ -18,8 +18,9 @@ test_invalid_grep_expression() {
18 '
19 }
20
21 -LC_ALL=en_US.UTF-8 test-tool regex '^.$' '¿' &&
22 - test_set_prereq MB_REGEX
21 +test_lazy_prereq MB_REGEX '
22 + LC_ALL=en_US.UTF-8 test-tool regex "^.$" "¿"
23 +'
24
25 cat >hello.c <<EOF
26 #include <assert.h>