Refactor input and output contents used in tests.