git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Test framework: prettyprint the failed command.

From
Junio C Hamano <junkio@cox.net>
Date
Jul 23, 2005, 02:09 UTC
Message-ID
<7vek9q6zoh.fsf@assigned-by-dhcp.cox.net>

The output from a failure case had the test description message and the first line of the actual test script concatenated on the same line, which was ugly. Correct the output routine a bit to make it more readable.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 t/test-lib.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
ba7b8ae0b3af6040c8af2f4e381bd4c30ab9cd24
diff --git a/t/test-lib.sh b/t/test-lib.sh
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -84,7 +84,9 @@ test_ok_ () {
 test_failure_ () {
 	test_count=$(expr "$test_count" + 1)
 	test_failure=$(expr "$test_failure" + 1);
-	say "FAIL $test_count: $@"
+	say "FAIL $test_count: $1"
+	shift
+	echo "$@" | sed -e 's/^/	/'
 	test "$immediate" == "" || exit 1
 }
 
Message 1 of 1 in “Test framework: prettyprint the failed command.”
  1. Test framework: prettyprint the failed command.Junio C Hamano, Jul 23, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.