aboutsummaryrefslogtreecommitdiff
path: root/t/helper/test-example-tap.c
diff options
context:
space:
mode:
authorPablo Sabater <pabloosabaterr@gmail.com>2026-03-11 04:14:42 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-11 11:38:54 -0700
commite30e9442fd9b90d96dde2fad4a6b26d7a03dee5e (patch)
treec6ef302cdcf0965b04dddda34f1028c94056cb2e /t/helper/test-example-tap.c
parent67ad42147a7acc2af6074753ebd03d904476118f (diff)
downloadgit-e30e9442fd9b90d96dde2fad4a6b26d7a03dee5e.tar.xz
test-lib: print escape sequence names
When printing expected/actual characters in failed checks, use their names (\a, \b, \n, ...) instead of their octal representation, making it easier to read. Add tests to test-example-tap.c Update t0080-unit-test-output.sh to match the desired output Teach 'print_one_char()' the equivalent name Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-example-tap.c')
-rw-r--r--t/helper/test-example-tap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/helper/test-example-tap.c b/t/helper/test-example-tap.c
index 229d495ecf..998a1f0b42 100644
--- a/t/helper/test-example-tap.c
+++ b/t/helper/test-example-tap.c
@@ -63,6 +63,8 @@ static void t_messages(void)
check_str("NULL", NULL);
check_char('a', ==, '\n');
check_char('\\', ==, '\'');
+ check_char('\a', ==, '\v');
+ check_char('\x00', ==, '\x01');
}
static void t_empty(void)
@@ -123,6 +125,8 @@ int cmd__example_tap(int argc UNUSED, const char **argv UNUSED)
check_str("NULL", NULL);
check_char('a', ==, '\n');
check_char('\\', ==, '\'');
+ check_char('\a', ==, '\v');
+ check_char('\x00', ==, '\x01');
}
if_test ("if_test test with no checks")
; /* nothing */