# [PATCH v2] t/t9001-send-email.sh: fix '&&' chain in some tests

2 messages from 2011-01-04 to 2011-01-04. Participants: Antonio Ospite, Junio C Hamano.
Thread: https://gitlist.dev/t/26193

## Antonio Ospite, 2011-01-04 20:56

Subject: [PATCH v2] t/t9001-send-email.sh: fix '&&' chain in some tests
Message-ID: <1294174618-14571-1-git-send-email-ospite@studenti.unina.it>
URL: https://gitlist.dev/e/1294174618-14571-1-git-send-email-ospite%40studenti.unina.it

```
t/README recommends chaining test assertions.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
---

Hi sorry for the delay,

the only change wrt. v1 is the use of test_might_fail with
git config --unset as requested by Jonathan.

Note that in t9001-send-email.sh and other tests git config --unset is used
without the test_might_fail handler some other times, you might wat to check
this.

Thanks and best regards,
   Antonio Ospite
   http://ao2.it

 t/t9001-send-email.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 1dc4a92..ace3c78 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -265,7 +265,7 @@ test_expect_success $PREREQ 'Author From: in message body' '
 		--to=nobody@example.com \
 		--smtp-server="$(pwd)/fake.sendmail" \
 		$patches &&
-	sed "1,/^\$/d" < msgtxt1 > msgbody1
+	sed "1,/^\$/d" < msgtxt1 > msgbody1 &&
 	grep "From: A <author@example.com>" msgbody1
 '
 
@@ -276,7 +276,7 @@ test_expect_success $PREREQ 'Author From: not in message body' '
 		--to=nobody@example.com \
 		--smtp-server="$(pwd)/fake.sendmail" \
 		$patches &&
-	sed "1,/^\$/d" < msgtxt1 > msgbody1
+	sed "1,/^\$/d" < msgtxt1 > msgbody1 &&
 	! grep "From: A <author@example.com>" msgbody1
 '
 
@@ -298,7 +298,7 @@ test_expect_success $PREREQ 'Invalid In-Reply-To' '
 		--in-reply-to=" " \
 		--smtp-server="$(pwd)/fake.sendmail" \
 		$patches \
-		2>errors
+		2>errors &&
 	! grep "^In-Reply-To: < *>" msgtxt1
 '
 
@@ -617,7 +617,7 @@ EOF
 "
 
 test_expect_success $PREREQ '--suppress-cc=sob' '
-	git config --unset sendemail.cccmd
+	test_might_fail git config --unset sendemail.cccmd &&
 	test_suppression sob
 '
 
-- 
1.7.2.3

```

## Junio C Hamano, 2011-01-04 23:56

Subject: Re: [PATCH v2] t/t9001-send-email.sh: fix '&&' chain in some tests
Message-ID: <7vei8sdxzk.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vei8sdxzk.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1294174618-14571-1-git-send-email-ospite@studenti.unina.it>

```
Thanks.

```
