Add convenient newline to test helpers

readline reads stdin until it receives a newline character (or some other
hard to understand condition is met), so this should help with some of
the test failures.