git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Tay Ray Chuan <rctay89@gmail.com>,
	Johannes Sixt <j6t@kdbg.org>
Subject: [PATCH] Fix a false negative in t5512 when run using sh -x
Date: Mon, 10 May 2010 09:19:06 +0200	[thread overview]
Message-ID: <1273475946-2079-1-git-send-email-j6t@kdbg.org> (raw)

The test compares the stderr of a git command called with test_must_fail
to some expected output. With bash (and probably other shells as well)
when run with -x turned on, command trace output ends up in the captured
output. Of course, the actual output does not match the expected output
anymore.

Use 'grep' to check for expected output.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t5512-ls-remote.sh |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
index 3cf1b3d..24c8684 100755
--- a/t/t5512-ls-remote.sh
+++ b/t/t5512-ls-remote.sh
@@ -86,10 +86,6 @@ test_expect_success 'use branch.<name>.remote if possible' '
 
 '
 
-cat >exp <<EOF
-fatal: 'refs*master' does not appear to be a git repository
-fatal: The remote end hung up unexpectedly
-EOF
 test_expect_success 'confuses pattern as remote when no remote specified' '
 	#
 	# Do not expect "git ls-remote <pattern>" to work; ls-remote, correctly,
@@ -103,7 +99,7 @@ test_expect_success 'confuses pattern as remote when no remote specified' '
 	# We could just as easily have used "master"; the "*" emphasizes its
 	# role as a pattern.
 	test_must_fail git ls-remote refs*master >actual 2>&1 &&
-	test_cmp exp actual
+	grep "does not appear to be a git repository" actual
 
 '
 
-- 
1.7.1.75.g68e2c

             reply	other threads:[~2010-05-10  7:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-10  7:19 Johannes Sixt [this message]
2010-05-10  7:28 ` [PATCH] Fix a false negative in t5512 when run using sh -x Tay Ray Chuan
2010-05-10  9:09 ` Sverre Rabbelier
2010-05-10 10:23   ` Johannes Sixt
2010-05-10 10:45     ` Sverre Rabbelier
2010-05-10 10:34   ` Jonathan Nieder
2010-05-10 11:03     ` Johannes Sixt
2010-05-10 11:31       ` Jonathan Nieder
2010-05-10 11:34         ` Johannes Sixt

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=1273475946-2079-1-git-send-email-j6t@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rctay89@gmail.com \
    /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).