On using the command:
tr -s '\n' ' '< test1
where test1 is a text file.
If test1 is written in a manner such that it contains newlines (linefeed characters) and not \n (backslash-n) then the answer comes as expected that is all the newlines get replaced by a single space.
But if say the test1 is formatted such that it contains \n (backslash-n) and not a newline then running the command the \n does not get replaced by a single space, E.g. if test1 contains
hello \n\n\n how are \n\n you
then the output is
hello \n\n\n how are \n\n you
and not
hello how are you