test: refactor line parsing into stream transform