From d492b31cafe9aa5ce001b1d48815f4c0bb40d01a Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Sat, 12 Jul 2008 17:47:52 +0200 Subject: t/: Use "test_must_fail git" instead of "! git" This patch changes every occurrence of "! git" -- with the meaning that a git call has to gracefully fail -- into "test_must_fail git". This is useful to - make sure the test does not fail because of a signal, e.g. SIGSEGV, and - advertise the use of "test_must_fail" for new tests. Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano --- t/t7501-commit.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 't/t7501-commit.sh') diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index d3370ff7ff..0edd9ddf73 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -19,7 +19,7 @@ test_expect_success \ test_expect_success \ "fail initial amend" \ - "! git-commit --amend" + "test_must_fail git-commit --amend" test_expect_success \ "initial commit" \ @@ -27,16 +27,16 @@ test_expect_success \ test_expect_success \ "invalid options 1" \ - "! git-commit -m foo -m bar -F file" + "test_must_fail git-commit -m foo -m bar -F file" test_expect_success \ "invalid options 2" \ - "! git-commit -C HEAD -m illegal" + "test_must_fail git-commit -C HEAD -m illegal" test_expect_success \ "using paths with -a" \ "echo King of the bongo >file && - ! git-commit -m foo -a file" + test_must_fail git-commit -m foo -a file" test_expect_success \ "using paths with --interactive" \ @@ -45,11 +45,11 @@ test_expect_success \ test_expect_success \ "using invalid commit with -C" \ - "! git-commit -C bogus" + "test_must_fail git-commit -C bogus" test_expect_success \ "testing nothing to commit" \ - "! git-commit -m initial" + "test_must_fail git-commit -m initial" test_expect_success \ "next commit" \ @@ -59,7 +59,7 @@ test_expect_success \ test_expect_success \ "commit message from non-existing file" \ "echo 'more bongo: bongo bongo bongo bongo' >file && \ - ! git-commit -F gah -a" + test_must_fail git-commit -F gah -a" # Empty except stray tabs and spaces on a few lines. sed -e 's/@$//' >msg <file && \ - ! git-commit -F msg -m amending ." + test_must_fail git-commit -F msg -m amending ." test_expect_success \ "using message from other commit" \ -- cgit v1.3-5-g9baa