From c5810975e3ec971fc8caf65f58b77c96c97b2571 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Sat, 8 Jul 2023 13:33:29 -0400 Subject: [PATCH] tests: Fix interactive test without libreadline. When using actual readline, the user's input is echoed internally, so the test case sees the actual input commands in the captured standard output. But in the getline-based fallback, the input is not reflected to the output. This is expected behaviour, but confuses the test case. Rewrite the check to accept either form. --- tests/general.at | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/general.at b/tests/general.at index b0806a3..498028e 100644 --- a/tests/general.at +++ b/tests/general.at @@ -158,7 +158,13 @@ quit ]]) AT_CHECK([cdecl99 --quiet --interactive /d' stdout], [0], [declare x as int + +# If built with readline support, then the input commands (including their +# trailing newlines) will be captured by AT_CHECK. Otherwise, they are not: +# the output just directly follows the prompt, and the final prompt will +# not end with a newline. Attempt to paper over these differences. +AT_CHECK([echo >>stdout; sed '/> [[eq]]/d; s/^> //; /^$/d' stdout], [0], +[declare x as int ]) AT_CLEANUP -- 2.43.2