mirror of
https://github.com/git/git
synced 2024-10-12 11:32:34 +00:00
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>
This commit is contained in:
parent
c6587bddc4
commit
be86fb3f8d
|
@ -35,9 +35,7 @@ test_expect_success setup '
|
||||||
for w in Some extra lines here; do echo $w; done >>one &&
|
for w in Some extra lines here; do echo $w; done >>one &&
|
||||||
git diff >patch.file &&
|
git diff >patch.file &&
|
||||||
patched=$(git hash-object --stdin <one) &&
|
patched=$(git hash-object --stdin <one) &&
|
||||||
git read-tree --reset -u HEAD &&
|
git read-tree --reset -u HEAD
|
||||||
|
|
||||||
echo happy.
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'safecrlf: autocrlf=input, all CRLF' '
|
test_expect_success 'safecrlf: autocrlf=input, all CRLF' '
|
||||||
|
@ -225,29 +223,9 @@ test_expect_success '.gitattributes says two is binary' '
|
||||||
git config core.autocrlf true &&
|
git config core.autocrlf true &&
|
||||||
git read-tree --reset -u HEAD &&
|
git read-tree --reset -u HEAD &&
|
||||||
|
|
||||||
if has_cr dir/two
|
test_must_fail has_cr dir/two &&
|
||||||
then
|
verbose has_cr one &&
|
||||||
echo "Huh?"
|
test_must_fail has_cr three
|
||||||
false
|
|
||||||
else
|
|
||||||
: happy
|
|
||||||
fi &&
|
|
||||||
|
|
||||||
if has_cr one
|
|
||||||
then
|
|
||||||
: happy
|
|
||||||
else
|
|
||||||
echo "Huh?"
|
|
||||||
false
|
|
||||||
fi &&
|
|
||||||
|
|
||||||
if has_cr three
|
|
||||||
then
|
|
||||||
echo "Huh?"
|
|
||||||
false
|
|
||||||
else
|
|
||||||
: happy
|
|
||||||
fi
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '.gitattributes says two is input' '
|
test_expect_success '.gitattributes says two is input' '
|
||||||
|
@ -256,13 +234,7 @@ test_expect_success '.gitattributes says two is input' '
|
||||||
echo "two crlf=input" >.gitattributes &&
|
echo "two crlf=input" >.gitattributes &&
|
||||||
git read-tree --reset -u HEAD &&
|
git read-tree --reset -u HEAD &&
|
||||||
|
|
||||||
if has_cr dir/two
|
test_must_fail has_cr dir/two
|
||||||
then
|
|
||||||
echo "Huh?"
|
|
||||||
false
|
|
||||||
else
|
|
||||||
: happy
|
|
||||||
fi
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '.gitattributes says two and three are text' '
|
test_expect_success '.gitattributes says two and three are text' '
|
||||||
|
|
Loading…
Reference in a new issue