\r\n
Test if output ends with `\r\n` before `\n`, since the test for `\n` will succeed if output is terminated with `\r\n`, so `\r\n` is properly stripped from output text.