Ãvar ArnfjÃrà Bjarmason wrote: > On Fri, Oct 1, 2010 at 10:23, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote: >> +check_exit_status () { >> +    echo "$1" >expect.status >> +    shift >> +    "$@" >> +    echo "$?" >actual.status >> +    test_cmp expect.status actual.status >> +} > > If we add this it should be in the test-lib.sh, it'll probably be > useful for other tests. FWIW a more generally useful function would have to look something like this: test_exit_status () { want_code=$1 shift "$@" exit_code=$? if test $exit_code = $want_code then return 0 else echo >&2 "test_exit_status $want_code: command had status $exit_code: $*" return 1 fi } to avoid touching the file system. > and > change the tests using test_expect_code in t1504-ceiling-dirs.sh and > t6020-merge-df.sh to use test_expect_success + test_expect_code. Not a bad thing to do anyway. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html