From 6747f318f50760d7a3a773e894df3d3ed449e5d7 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 7 Nov 2024 00:02:27 +0300 Subject: test suite: fixed failure detection in the commandline-editing test cases * The program exit code will usually not signal failures since they are caught earlier. * Therefore, we always have to capture and check stderr. --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index d561d33..892f15c 100644 --- a/src/main.c +++ b/src/main.c @@ -457,6 +457,10 @@ main(int argc, char **argv) teco_machine_main_init(&teco_cmdline.machine, &local_qregs, TRUE); if (G_UNLIKELY(teco_fake_cmdline != NULL)) { + /* + * NOTE: Most errors are already catched at a higher level, + * so you cannot rely on the exit code to detect them. + */ if (!teco_cmdline_keypress(teco_fake_cmdline, strlen(teco_fake_cmdline), &error) && !g_error_matches(error, TECO_ERROR, TECO_ERROR_QUIT)) { teco_error_add_frame_toplevel(); -- cgit v1.2.3