t: don't spuriously close and reopen quotes
In the test scripts, the recommended style is, e.g.:
test_expect_success 'name' '
do-something somehow &&
do-some-more testing
'
When using this style, any single quote in the multi-line test section
is actually closing the lone single quotes that surround it.
It can be a non-issue in practice:
test_expect_success 'sed a little' '
sed -e 's/hi/lo/' in >out # "ok": no whitespace in s/hi/lo/
'
Or it can be a bug in the test, e.g., because variable interpolation
happens before the test even begins executing:
v=abc
test_expect_success 'variable interpolation' '
v=def &&
echo '"$v"' # abc
'
Change several such in-test single quotes to use double quotes instead
or, in a few cases, drop them altogether. These were identified using
some crude grepping. We're not fixing any test bugs here, but we're
hopefully making these tests slightly easier to grok and to maintain.
There are legitimate use cases for closing a quote and opening a new
one, e.g., both '\'' and '"'"' can be used to produce a literal single
quote. I'm not touching any of those here.
In t9401, tuck the redirecting ">" to the filename while we're touching
those lines.
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
dc04167d37
commit
c76b84a121
@ -213,7 +213,7 @@ test_expect_success 'fetch tags when there is no tags' '
|
||||
test_expect_success 'fetch following tags' '
|
||||
|
||||
cd "$D" &&
|
||||
git tag -a -m 'annotated' anno HEAD &&
|
||||
git tag -a -m "annotated" anno HEAD &&
|
||||
git tag light HEAD &&
|
||||
|
||||
mkdir four &&
|
||||
@ -331,7 +331,7 @@ test_expect_success 'bundle does not prerequisite objects' '
|
||||
test_expect_success 'bundle should be able to create a full history' '
|
||||
|
||||
cd "$D" &&
|
||||
git tag -a -m '1.0' v1.0 master &&
|
||||
git tag -a -m "1.0" v1.0 master &&
|
||||
git bundle create bundle4 v1.0
|
||||
|
||||
'
|
||||
|
||||
Reference in New Issue
Block a user