Rewriting tests with new IO interface