git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] t1450: fix testcases that were wrongly expecting failure
Date: Sat, 20 Feb 2010 01:18:44 +0100	[thread overview]
Message-ID: <491d6695b46414db1721235759fa1887421c9915.1266625101.git.trast@student.ethz.ch> (raw)

Almost exactly a year ago in 02a6552 (Test fsck a bit harder), I
introduced two testcases that were expecting failure.

However, the only bug was that the testcases wrote *blobs* because I
forgot to pass -t tag to hash-object.  Fix this, and then adjust the
rest of the test to properly check the result.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 t/t1450-fsck.sh |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index a22632f..49cae3e 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -66,12 +66,12 @@ tagger T A Gger <tagger@example.com> 1234567890 -0000
 This is an invalid tag.
 EOF
 
-test_expect_failure 'tag pointing to nonexistent' '
-	tag=$(git hash-object -w --stdin < invalid-tag) &&
+test_expect_success 'tag pointing to nonexistent' '
+	tag=$(git hash-object -t tag -w --stdin < invalid-tag) &&
 	echo $tag > .git/refs/tags/invalid &&
-	git fsck --tags 2>out &&
+	test_must_fail git fsck --tags >out &&
 	cat out &&
-	grep "could not load tagged object" out &&
+	grep "broken link" out &&
 	rm .git/refs/tags/invalid
 '
 
@@ -84,12 +84,12 @@ tagger T A Gger <tagger@example.com> 1234567890 -0000
 This is an invalid tag.
 EOF
 
-test_expect_failure 'tag pointing to something else than its type' '
-	tag=$(git hash-object -w --stdin < wrong-tag) &&
+test_expect_success 'tag pointing to something else than its type' '
+	tag=$(git hash-object -t tag -w --stdin < wrong-tag) &&
 	echo $tag > .git/refs/tags/wrong &&
-	git fsck --tags 2>out &&
+	test_must_fail git fsck --tags 2>out &&
 	cat out &&
-	grep "some sane error message" out &&
+	grep "error in tag.*broken links" out &&
 	rm .git/refs/tags/wrong
 '
 
-- 
1.7.0.139.gd1a75.dirty

                 reply	other threads:[~2010-02-20  0:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=491d6695b46414db1721235759fa1887421c9915.1266625101.git.trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).