Skip to content

Commit

Permalink
t1450: fix testcases that were wrongly expecting failure
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Thomas Rast authored and Junio C Hamano committed Feb 20, 2010
1 parent e9e9219 commit 4551d03
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions t/t1450-fsck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'

Expand All @@ -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
'

Expand Down

0 comments on commit 4551d03

Please sign in to comment.