git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t/t9001-send-email.sh: fix '&&' chain in some tests
@ 2010-11-22 12:31 Antonio Ospite
  2010-11-22 17:00 ` Jonathan Nieder
  0 siblings, 1 reply; 2+ messages in thread
From: Antonio Ospite @ 2010-11-22 12:31 UTC (permalink / raw)
  To: git; +Cc: Antonio Ospite, Junio C Hamano

t/README recommends chaining test assertions.

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

Hi,

there are a couple of tests I didn't fix here, they are storing intermediate
return values, see "confirm by default (due to cc)" and following in
t/t9001-send-email.sh

I don't know if chaining is correct already there.

Thanks,
   Antonio

 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 d1ba252..ac1af86 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
 '
 
@@ -574,7 +574,7 @@ EOF
 "
 
 test_expect_success $PREREQ '--suppress-cc=sob' '
-	git config --unset sendemail.cccmd
+	git config --unset sendemail.cccmd &&
 	test_suppression sob
 '
 
-- 
1.7.2.3

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

* Re: [PATCH] t/t9001-send-email.sh: fix '&&' chain in some tests
  2010-11-22 12:31 [PATCH] t/t9001-send-email.sh: fix '&&' chain in some tests Antonio Ospite
@ 2010-11-22 17:00 ` Jonathan Nieder
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Nieder @ 2010-11-22 17:00 UTC (permalink / raw)
  To: Antonio Ospite; +Cc: git, Junio C Hamano

Hi,

Antonio Ospite wrote:

> --- a/t/t9001-send-email.sh
> +++ b/t/t9001-send-email.sh
> @@ -261,10 +262,10 @@ test_expect_success $PREREQ 'Author From: in message body' '
> test_expect_success $PREREQ 'Author From: in message body' '
> 	clean_fake_sendmail &&
> 	git send-email \
> 		--from="Example <nobody@example.com>" \
>  		--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
>  '
[...]
>  		$patches &&
> -	sed "1,/^\$/d" < msgtxt1 > msgbody1
> +	sed "1,/^\$/d" < msgtxt1 > msgbody1 &&
[...]
> @@ -300,5 +300,5 @@ test_expect_success $PREREQ 'Invalid In-Reply-To' '
>  		$patches \
> -		2>errors
> +		2>errors &&

Good.

> @@ -574,7 +574,7 @@ EOF
>  "
>  
>  test_expect_success $PREREQ '--suppress-cc=sob' '
> -	git config --unset sendemail.cccmd
> +	git config --unset sendemail.cccmd &&

This one needs a test_might_fail in front, since "git config --unset"
would fail if some future change causes the configuration item not to
be set in the first place.

Thanks.

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

end of thread, other threads:[~2010-11-22 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-22 12:31 [PATCH] t/t9001-send-email.sh: fix '&&' chain in some tests Antonio Ospite
2010-11-22 17:00 ` Jonathan Nieder

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).