Refactoring test helpers and add parse_test.