git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: Jeff King <peff@peff.net>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: [PATCH] test_must_fail: compare exit_code using integer -eq operator
Date: Wed, 25 Nov 2015 22:05:24 +0000	[thread overview]
Message-ID: <565630A4.7070205@ramsayjones.plus.com> (raw)


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

             reply	other threads:[~2015-11-25 22:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 22:05 Ramsay Jones [this message]
2015-11-28 16:58 ` [PATCH] test_must_fail: compare exit_code using integer -eq operator Jeff King

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=565630A4.7070205@ramsayjones.plus.com \
    --to=ramsay@ramsayjones.plus.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).