[PATCH v2 4/5] t3301: use test_must_fail instead of !
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Feb 14, 2009, 20:23 UTC
- Message-ID
- <8c50889d27e5baec1cbbd9a5775fa80b986c6df6.1234642638.git.trast@student.ethz.ch>
- In-Reply-To
- <200902142056.42198.trast@student.ethz.ch>
We should use test_must_fail to negate output status, so that segfaults can be caught. One instance of ! negation remains, but that actually tests the return code of 'grep'.
Signed-off-by: Thomas Rast <trast@student.ethz.ch> ---
New in this series.
t/t3301-notes.sh | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh index 43d82a2..764fad5 100755 --- a/t/t3301-notes.sh +++ b/t/t3301-notes.sh @@ -16,7 +16,7 @@ VISUAL=./fake_editor.sh export VISUAL test_expect_success 'cannot annotate non-existing HEAD' ' - ! MSG=3 git notes edit + MSG=3 test_must_fail git notes edit ' test_expect_success setup ' @@ -31,8 +31,8 @@ test_expect_success setup ' ' test_expect_success 'need valid notes ref' ' - ! MSG=1 GIT_NOTES_REF=/ git notes edit && - ! MSG=2 GIT_NOTES_REF=/ git notes show + MSG=1 GIT_NOTES_REF=/ test_must_fail git notes edit && + MSG=2 GIT_NOTES_REF=/ test_must_fail git notes show ' # 1 indicates caught gracefully by die, 128 means git-show barked @@ -47,7 +47,7 @@ test_expect_success 'create notes' ' test 1 = $(git ls-tree refs/notes/commits | wc -l) && test b1 = $(git notes show) && git show HEAD^ && - ! git notes show HEAD^ + test_must_fail git notes show HEAD^ ' cat > expect << EOF
-- 1.6.2.rc0.296.ge2122