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

[PATCH v6 1/7] tests: test number comes first in 'not ok $count - $message'

From
Adam Spiers <git@adamspiers.org>
Date
Dec 16, 2012, 18:28 UTC
Message-ID
<1355682495-22382-2-git-send-email-git@adamspiers.org>
In-Reply-To
<1355682495-22382-1-git-send-email-git@adamspiers.org>

The old output to say "not ok - 1 messsage" was working by accident only because the test numbers are optional in TAP.

Signed-off-by: Adam Spiers <git@adamspiers.org>
---
 t/t0000-basic.sh | 4 ++--
 t/test-lib.sh    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 562cf41..46ccda3 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -189,13 +189,13 @@ test_expect_success 'tests clean up even on failures' "
 	! test -s err &&
 	! test -f \"trash directory.failing-cleanup/clean-after-failure\" &&
 	sed -e 's/Z$//' -e 's/^> //' >expect <<-\\EOF &&
-	> not ok - 1 tests clean up even after a failure
+	> not ok 1 - tests clean up even after a failure
 	> #	Z
 	> #	touch clean-after-failure &&
 	> #	test_when_finished rm clean-after-failure &&
 	> #	(exit 1)
 	> #	Z
-	> not ok - 2 failure to clean up causes the test to fail
+	> not ok 2 - failure to clean up causes the test to fail
 	> #	Z
 	> #	test_when_finished \"(exit 2)\"
 	> #	Z
diff --git a/t/test-lib.sh b/t/test-lib.sh
index f50f834..d0b236f 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -298,7 +298,7 @@ test_ok_ () {
 
 test_failure_ () {
 	test_failure=$(($test_failure + 1))
-	say_color error "not ok - $test_count $1"
+	say_color error "not ok $test_count - $1"
 	shift
 	echo "$@" | sed -e 's/^/#	/'
 	test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; }
-- 
1.7.12.1.396.g53b3ea9
Previous: Adam SpiersNext: Adam Spiers
Message 2 of 18 in “make test output coloring more intuitive”
  1. 0/7 make test output coloring more intuitiveAdam Spiers, Dec 16, 2012
  2. 1/7 tests: test number comes first in 'not ok $count - $message'Adam Spiers, Dec 16, 2012
  3. 2/7 tests: paint known breakages in bold yellowAdam Spiers, Dec 16, 2012
  4. 3/7 tests: paint skipped tests in bold blueAdam Spiers, Dec 16, 2012
  5. 4/7 tests: change info messages from yellow/brown to bold cyanAdam Spiers, Dec 16, 2012
  6. 5/7 tests: refactor mechanics of testing in a sub test-libAdam Spiers, Dec 16, 2012
  7. 6/7 tests: test the test framework more thoroughlyAdam Spiers, Dec 16, 2012
  8. 7/7 tests: paint unexpectedly fixed known breakages in bold redAdam Spiers, Dec 16, 2012
  9. Junio C HamanoDec 16, 2012
  10. Adam SpiersDec 16, 2012
  11. Junio C HamanoDec 16, 2012
  12. Jeff KingDec 20, 2012
  13. Adam SpiersDec 20, 2012
  14. Jeff KingDec 20, 2012
  15. Adam SpiersDec 20, 2012
  16. Junio C HamanoDec 20, 2012
  17. Jeff KingDec 20, 2012
  18. Adam SpiersDec 20, 2012

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.