git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH 7/8] t9819: don't use test_must_fail with p4
Date: Mon, 20 Apr 2020 04:54:45 -0400	[thread overview]
Message-ID: <e0d2bf4a204d56a629a417aa798e9efc208f4b08.1587372771.git.liu.denton@gmail.com> (raw)
In-Reply-To: <cover.1587372771.git.liu.denton@gmail.com>

We were using `test_must_fail p4` to test that the p4 command failed as
expected. However, test_must_fail() is used to ensure that commands fail
in an expected way, not due to something like a segv. Since we are not
in the business of verifying the sanity of the external world, replace
`test_must_fail p4` with `! p4` and assume that the `p4` command does
not die unexpectedly.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 t/t9819-git-p4-case-folding.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t9819-git-p4-case-folding.sh b/t/t9819-git-p4-case-folding.sh
index 600ce1e0b0..b4d93f0c17 100755
--- a/t/t9819-git-p4-case-folding.sh
+++ b/t/t9819-git-p4-case-folding.sh
@@ -30,7 +30,7 @@ test_expect_success 'Check p4 is in case-folding mode' '
 		cd "$cli" &&
 		>lc/FILE.TXT &&
 		p4 add lc/FILE.TXT &&
-		test_must_fail p4 submit -d "Cannot add file differing only in case" lc/FILE.TXT
+		! p4 submit -d "Cannot add file differing only in case" lc/FILE.TXT
 	)
 '
 
-- 
2.26.0.159.g23e2136ad0


  parent reply	other threads:[~2020-04-20  8:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20  8:54 [PATCH 0/8] t: replace incorrect test_must_fail usage (part 4) Denton Liu
2020-04-20  8:54 ` [PATCH 1/8] t6030: use test_path_is_missing() Denton Liu
2020-04-20  8:54 ` [PATCH 2/8] t7408: replace incorrect uses of test_must_fail Denton Liu
2020-04-20  8:54 ` [PATCH 3/8] t7508: don't use `test_must_fail test_cmp` Denton Liu
2020-04-21 20:59   ` Johannes Sixt
2020-04-20  8:54 ` [PATCH 4/8] t9141: use test_path_is_missing() Denton Liu
2020-04-20  8:54 ` [PATCH 5/8] t9160: " Denton Liu
2020-04-20  8:54 ` [PATCH 6/8] t9164: don't use `test_must_fail test_cmp` Denton Liu
2020-04-20 16:21   ` Eric Sunshine
2020-04-20 20:09     ` Junio C Hamano
2020-04-20 20:13       ` Eric Sunshine
2020-04-21 20:16       ` Denton Liu
2020-04-21 20:44         ` Junio C Hamano
2020-04-22  8:54           ` Denton Liu
2020-04-22 15:50             ` Junio C Hamano
2020-04-20  8:54 ` Denton Liu [this message]
2020-04-20  8:54 ` [PATCH 8/8] t9902: don't use `test_must_fail __git_*` Denton Liu
2020-04-21 21:16   ` Johannes Sixt
2020-04-22  8:35     ` Denton Liu
2020-04-20 11:49 ` [PATCH 0/8] t: replace incorrect test_must_fail usage (part 4) Derrick Stolee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e0d2bf4a204d56a629a417aa798e9efc208f4b08.1587372771.git.liu.denton@gmail.com \
    --to=liu.denton@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).