Skip to content

Commit

Permalink
t0008: document test_expect_success_multi
Browse files Browse the repository at this point in the history
test_expect_success_multi() helper function warrants some explanation,
since at first sight it may seem like generic test framework plumbing,
but is in fact specific to testing check-ignore, and allows more
thorough testing of the various output formats without significantly
increase the size of t0008.

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 Feb 19, 2013
1 parent 72aeb18 commit 6866654
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions t/t0008-ignores.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ test_check_ignore () {
stderr_empty_on_success "$expect_code"
}

# Runs the same code with 3 different levels of output verbosity,
# expecting success each time. Takes advantage of the fact that
# check-ignore --verbose output is the same as normal output except
# for the extra first column.
#
# Arguments:
# - (optional) prereqs for this test, e.g. 'SYMLINKS'
# - test name
# - output to expect from -v / --verbose mode
# - code to run (should invoke test_check_ignore)
test_expect_success_multi () {
prereq=
if test $# -eq 4
Expand Down

0 comments on commit 6866654

Please sign in to comment.