git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] test_must_fail: compare exit_code using integer -eq operator
@ 2015-11-25 22:05 Ramsay Jones
  2015-11-28 16:58 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2015-11-25 22:05 UTC (permalink / raw)
  To: Jeff King; +Cc: GIT Mailing-list


Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---

Hi Jeff,

Can we squash this into your fixup?

ATB,
Ramsay Jones

 t/test-lib-functions.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 85aeaf9..2bb639e 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -605,22 +605,22 @@ test_must_fail () {
 	esac
 	"$@"
 	exit_code=$?
-	if test $exit_code = 0 && ! test_list_contains "$_test_ok" success
+	if test $exit_code -eq 0 && ! test_list_contains "$_test_ok" success
 	then
 		echo >&2 "test_must_fail: command succeeded: $*"
 		return 1
-	elif test $exit_code = 141 && test_list_contains "$_test_ok" sigpipe
+	elif test $exit_code -eq 141 && test_list_contains "$_test_ok" sigpipe
 	then
 		return 0
 	elif test $exit_code -gt 129 && test $exit_code -le 192
 	then
 		echo >&2 "test_must_fail: died by signal: $*"
 		return 1
-	elif test $exit_code = 127
+	elif test $exit_code -eq 127
 	then
 		echo >&2 "test_must_fail: command not found: $*"
 		return 1
-	elif test $exit_code = 126
+	elif test $exit_code -eq 126
 	then
 		echo >&2 "test_must_fail: valgrind error: $*"
 		return 1
-- 
2.6.0

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

* Re: [PATCH] test_must_fail: compare exit_code using integer -eq operator
  2015-11-25 22:05 [PATCH] test_must_fail: compare exit_code using integer -eq operator Ramsay Jones
@ 2015-11-28 16:58 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2015-11-28 16:58 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: GIT Mailing-list

On Wed, Nov 25, 2015 at 10:05:24PM +0000, Ramsay Jones wrote:

> Hi Jeff,
> 
> Can we squash this into your fixup?

I think it's a good thing to do, but I had figured it could be a
separate patch (especially since it is touching lines that are otherwise
unchanged by the patch). Looks like Lars folded it into his patch,
though, and I am OK with that, too.

-Peff

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

end of thread, other threads:[~2015-11-28 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-25 22:05 [PATCH] test_must_fail: compare exit_code using integer -eq operator Ramsay Jones
2015-11-28 16:58 ` Jeff King

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