|
Currently, updating a test that uses ASSERT_EXPLAIN requires several steps. For example what I do is:
- Find the definition of kDebugAsserts and change it to 'true' temporarily.
- Run the unit test.
- Find either `V2` or `V2Compact` in the output; copy it.
- Paste it into the .cpp
- Use editor shortcuts to fix the quoting and indentation.
There are some easy ways to improve this:
- Remove the kDebugAsserts flag. Instead, have the macro print whenever the comparison fails. (And not when it succeeds.)
- Have the macro print using only one explain format (the one relevant to that assertion).
- Have the printed output be already string-quoted and ready to copy-paste into the .cpp.
Then the steps would be:
- Run the unit test.
- Find the only expected-output message; copy it.
- Paste it into the .cpp
|