Strip newline off "test" commands too!

With due thanks to @asm582 for testing