as pointed out by Steven Segletes, only consecutive spaces are compressed
into a single space, so a \newcommand in the middle of text, with a
space on either side, will result in a wider space in the output.
if you are looking for readability in the source file, you can avoid the
spacy output at the cost of more lines in the source:
Test
\newcommand{\foo}{}%
Test
the same spacy result is often caused by inserting multiple \index entries for the same text in a source file, and can be solved in the
same way:
some text
\index{index item}%
\index{item to be indexed}%
item to be indexed
i know you probably haven't reached that problem yet, but it's a good
idea to learn good habits early.
\newcommandand before the finalTest, both of which are actualized. If you had two consecutive spaces, it would be treated as a single space, but that is not the case here. – Steven B. Segletes 9 hours ago\newcommand{\foo}{}, but write a%immediately afterwards and then put the secondTeston the next line of code. It seems more readable to me, at least. – justin 7 hours ago