With this change the parse_line method will no longer throw assertion errors when reasons contain tab characters or invalid key=value pairs.

As a side effect, improperly formatted key=value optional parts (and all valid key=value pairs after) will be rolled into the reason.

I've added a new unit test, test_parse_line_handles_tabs_in_reason, and removed the now deprecated unit test,  test_parse_line_fails_on_bad_optional_fields.

A previous CL for multi-line support also used strip() on the status line when the pre-CL behavior would only remove trailing '\n'. I've reverted the code to reflect the original behavior.

I'm open to suggestions on a more complete regex for matching key names. For our test base, \w is sufficient.

Change-Id: I351a61080dd335aa591b90565b5cc53f558641e0

TEST=Unit tests plus in production runs.

Review URL: http://codereview.chromium.org/3885001
2 files changed