diff options
author | Martin Ågren <martin.agren@gmail.com> | 2020-08-06 22:08:54 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-08-06 15:14:34 -0700 |
commit | 289218de2b5cc17e88d7a04f46fc8302142da8d0 (patch) | |
tree | ba954fb045b82c7a991a1e1ec63dd03d5d64e459 /add-interactive.h | |
parent | t: don't spuriously close and reopen quotes (diff) | |
download | tgif-289218de2b5cc17e88d7a04f46fc8302142da8d0.tar.xz |
t4104: modernize and simplify quoting
Drop whitespace in the value of `$test_description` and in a test body
and use `test_write_lines`.
Stop defining `$u` with a trailing space just so that we can tuck it in
like `git foo $u$more...` and get minimal whitespace in the command:
`git foo $u $more...` is more readable at the "cost" of an empty `$u`
yielding `git foo something...`.
Finally, avoid using single quotes within the test scripts to repeatedly
close and reopen the quotes that wrap the test scripts (see the previous
commit). This "unnecessary" quoting does mean that the verbose test
output shows the interpolated values, i.e., the shell code we're
running. But the downside is that the source of the script does *not*
show the shell code we're eventually executing, leaving the reader to
reason about what we really do and whether there are any quoting issues.
(There aren't.)
Where we run through loops to generate several "identical but different"
tests, the test message contains the interpolated variables we're
looping on, meaning one can always identify exactly which instance has
failed, even if the verbose test output shows the exact same test body
several times.
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'add-interactive.h')
0 files changed, 0 insertions, 0 deletions