t0020: use test_* helpers instead of hand-rolled messages
These tests are not wrong, but it is much shorter and more idiomatic to say "verbose" or "test_must_fail" rather than printing our own messages on failure. Likewise, there is no need to say "happy" at the end of a test; the test suite takes care of that. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Mar 25, 2015 at 01:31 UTC
be86fb3f8d149b721ab7db63cf46020fd622806d
1 file changed
+5
-33
t/t0020-crlf.sh
+5
-33
@@ -35,9 +35,7 @@ test_expect_success setup '
35
for w in Some extra lines here; do echo $w; done >>one &&
36
git diff >patch.file &&
37
patched=$(git hash-object --stdin <one) &&
38
- git read-tree --reset -u HEAD &&
39
-
40
- echo happy.
38
+ git read-tree --reset -u HEAD
39
'
40
41
test_expect_success 'safecrlf: autocrlf=input, all CRLF' '
@@ -225,29 +223,9 @@ test_expect_success '.gitattributes says two is binary' '
223
git config core.autocrlf true &&
224
git read-tree --reset -u HEAD &&
225
228
- if has_cr dir/two
229
- then
230
- echo "Huh?"
231
- false
232
- else
233
- : happy
234
- fi &&
235
-
236
- if has_cr one
237
- then
238
- : happy
239
- else
240
- echo "Huh?"
241
- false
242
- fi &&
243
-
244
- if has_cr three
245
- then
246
- echo "Huh?"
247
- false
248
- else
249
- : happy
250
- fi
226
+ test_must_fail has_cr dir/two &&
227
+ verbose has_cr one &&
228
+ test_must_fail has_cr three
229
'
230
231
test_expect_success '.gitattributes says two is input' '
@@ -256,13 +234,7 @@ test_expect_success '.gitattributes says two is input' '
234
echo "two crlf=input" >.gitattributes &&
235
git read-tree --reset -u HEAD &&
236
259
- if has_cr dir/two
260
- then
261
- echo "Huh?"
262
- false
263
- else
264
- : happy
265
- fi
237
+ test_must_fail has_cr dir/two
238
'
239
240
test_expect_success '.gitattributes says two and three are text' '