git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] t7406: Make a test_must_fail call fail for the right reason
@ 2018-08-03 23:14 Elijah Newren
  2018-08-03 23:40 ` Eric Sunshine
                   ` (2 more replies)
  0 siblings, 3 replies; 33+ messages in thread
From: Elijah Newren @ 2018-08-03 23:14 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren

A test making use of test_must_fail was failing like this:
  fatal: ambiguous argument '|': unknown revision or path not in the working tree.
when the intent was to verify that a specific string was not found
in the output of the git diff command, i.e. that grep returned
non-zero.  Fix the test to do that.
---
 t/t7406-submodule-update.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index f604ef7a72..7be8b59569 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -599,7 +599,7 @@ test_expect_success 'submodule update - update=none in .git/config but --checkou
 	 ) &&
 	 git diff --raw | grep "	submodule" &&
 	 git submodule update --checkout &&
-	 test_must_fail git diff --raw \| grep "	submodule" &&
+	 git diff --raw | test_must_fail grep "	submodule" &&
 	 (cd submodule &&
 	  test_must_fail compare_head
 	 ) &&
-- 
2.18.0.548.gcd835b18f7


^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2018-08-18 20:52 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-03 23:14 [PATCH] t7406: Make a test_must_fail call fail for the right reason Elijah Newren
2018-08-03 23:40 ` Eric Sunshine
2018-08-03 23:42   ` Eric Sunshine
2018-08-03 23:41 ` Junio C Hamano
2018-08-06 15:25 ` [PATCH 0/2] Simple fixes to t7406 Elijah Newren
2018-08-06 15:25   ` [PATCH 1/3] t7406: simplify by using diff --name-only instead of diff --raw Elijah Newren
2018-08-06 15:25   ` [PATCH 2/3] t7406: avoid having git commands upstream of a pipe Elijah Newren
2018-08-06 15:48     ` SZEDER Gábor
2018-08-06 16:09       ` Elijah Newren
2018-08-06 15:25   ` [PATCH 3/3] t7406: make a test_must_fail call fail for the right reason Elijah Newren
2018-08-07  9:07     ` SZEDER Gábor
2018-08-07 13:46       ` Elijah Newren
2018-08-07  7:50   ` [PATCH 0/2] Simple fixes to t7406 Martin Ågren
2018-08-07 13:40     ` Elijah Newren
2018-08-07 16:49   ` [PATCHv3 0/5] " Elijah Newren
2018-08-07 16:49     ` [PATCHv3 1/5] t7406: simplify by using diff --name-only instead of diff --raw Elijah Newren
2018-08-07 17:29       ` Junio C Hamano
2018-08-07 17:40         ` Elijah Newren
2018-08-07 18:18           ` Junio C Hamano
2018-08-07 16:49     ` [PATCHv3 2/5] t7406: avoid having git commands upstream of a pipe Elijah Newren
2018-08-07 16:49     ` [PATCHv3 3/5] t7406: prefer test_* helper functions to test -[feds] Elijah Newren
2018-08-07 17:34       ` Junio C Hamano
2018-08-07 16:49     ` [PATCHv3 4/5] t7406: avoid using test_must_fail for commands other than git Elijah Newren
2018-08-07 16:49     ` [PATCHv3 5/5] t7406: fix call that was failing for the wrong reason Elijah Newren
2018-08-07 17:37       ` Junio C Hamano
2018-08-08 16:31     ` [PATCHv4 0/5] Simple fixes to t7406 Elijah Newren
2018-08-08 16:31       ` [PATCHv4 1/5] t7406: fix call that was failing for the wrong reason Elijah Newren
2018-08-08 16:31       ` [PATCHv4 2/5] t7406: simplify by using diff --name-only instead of diff --raw Elijah Newren
2018-08-08 16:31       ` [PATCHv4 3/5] t7406: avoid having git commands upstream of a pipe Elijah Newren
2018-08-08 16:31       ` [PATCHv4 4/5] t7406: prefer test_* helper functions to test -[feds] Elijah Newren
2018-08-08 16:31       ` [PATCHv4 5/5] t7406: avoid using test_must_fail for commands other than git Elijah Newren
2018-08-13 20:28     ` [PATCHv3 0/5] Simple fixes to t7406 SZEDER Gábor
2018-08-18 20:52       ` Elijah Newren

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).