some changes to the tests to ensure code always leaves a newline character