path: root/t/
diff options
authorMartin Ågren <>2020-08-06 20:08:53 (GMT)
committerJunio C Hamano <>2020-08-06 22:14:32 (GMT)
commitc76b84a12160476fa795831ef3c2236e68c24f36 (patch)
tree62f0c818bfd20543e58f66beb67288a36d890668 /t/
parentdc04167d378fb29d30e1647ff6ff51dd182bc9a3 (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/')
1 files changed, 3 insertions, 3 deletions
diff --git a/t/ b/t/
index 3055943..e4bb220 100755
--- a/t/
+++ b/t/
@@ -63,16 +63,16 @@ test_expect_success "$name" '
name='detect node change from file to directory #1'
-test_expect_success "$name" "
+test_expect_success "$name" '
mkdir dir/new_file &&
mv dir/file dir/new_file/file &&
mv dir/new_file dir/file &&
git update-index --remove dir/file &&
git update-index --add dir/file/file &&
- git commit -m '$name' &&
+ git commit -m "$name" &&
test_must_fail git svn set-tree --find-copies-harder --rmdir \
name='detect node change from directory to file #1'