Staging
v0.8.1
Revision 90d0ed96b76ee51f8ae6f32923b92e7b20ba73c0 authored by Junio C Hamano on 28 February 2008, 21:09:30 UTC, committed by Junio C Hamano on 03 March 2008, 07:15:06 UTC
When we expect a git command to notice and signal errors, we
carelessly wrote in our tests:

    test_expect_success 'reject bogus request' '
        do something &&
        do something else &&
        ! git command
    '

but a non-zero exit could come from the "git command" segfaulting.

A new helper function "tset_must_fail" is introduced and it is
meant to be used to make sure the command gracefully fails (iow,
dying and exiting with non zero status is counted as a failure
to "gracefully fail").  The above example should be written as:

    test_expect_success 'reject bogus request' '
        do something &&
        do something else &&
        test_must_fail git command
    '

Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent fcbcfe7
History
File Mode Size
sha1.c -rw-r--r-- 1.7 KB
sha1.h -rw-r--r-- 402 bytes
sha1_arm.S -rw-r--r-- 3.5 KB

back to top