t1450: fix testcases that were wrongly expecting failure
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>
Thomas Rast committed
Feb 20, 2010 at 01:18 UTC
4551d03541e5eec411bb367f7967ff933d176df4
1 file changed
+8
-8
t/t1450-fsck.sh
+8
-8
@@ -66,12 +66,12 @@ tagger T A Gger <tagger@example.com> 1234567890 -0000
66
This is an invalid tag.
67
EOF
68
69
-test_expect_failure 'tag pointing to nonexistent' '
70
- tag=$(git hash-object -w --stdin < invalid-tag) &&
69
+test_expect_success 'tag pointing to nonexistent' '
70
+ tag=$(git hash-object -t tag -w --stdin < invalid-tag) &&
71
echo $tag > .git/refs/tags/invalid &&
72
- git fsck --tags 2>out &&
72
+ test_must_fail git fsck --tags >out &&
73
cat out &&
74
- grep "could not load tagged object" out &&
74
+ grep "broken link" out &&
75
rm .git/refs/tags/invalid
76
'
77
@@ -84,12 +84,12 @@ tagger T A Gger <tagger@example.com> 1234567890 -0000
84
This is an invalid tag.
85
EOF
86
87
-test_expect_failure 'tag pointing to something else than its type' '
88
- tag=$(git hash-object -w --stdin < wrong-tag) &&
87
+test_expect_success 'tag pointing to something else than its type' '
88
+ tag=$(git hash-object -t tag -w --stdin < wrong-tag) &&
89
echo $tag > .git/refs/tags/wrong &&
90
- git fsck --tags 2>out &&
90
+ test_must_fail git fsck --tags 2>out &&
91
cat out &&
92
- grep "some sane error message" out &&
92
+ grep "error in tag.*broken links" out &&
93
rm .git/refs/tags/wrong
94
'
95