Skip to content

Commit

Permalink
tests: test number comes first in 'not ok $count - $message'
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Adam Spiers authored and Junio C Hamano committed Dec 16, 2012
1 parent b0576a6 commit 5e5c006
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions t/t0000-basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,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
Expand Down
2 changes: 1 addition & 1 deletion t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,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; }
Expand Down

0 comments on commit 5e5c006

Please sign in to comment.