Change test log messages to be more readable #8940
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is more to get feedback than anything, because I haven't checked to for tests that would break (I don't believe there are any).
Current problem
If you have a detailed error message that gets written, it calls show on the string and removes any formatting that might have been applied. For example, I have something that tests if two items are equal and sets the message to
"Expected: " ++ show expected ++ "\nActual : " ++ show actual
.Proposed solution
It would be more useful if the test logs displayed the message directly.
read
is never used on the log files, so being able to do the inverse ofshow
isn't very useful there.Potential changes
Rather than what I have proposed, perhaps display the message on the next line, and indent it (and all lines of the message) to be more visually obvious.
Additionally, there appears to be a line length limit in the logs, which makes it weird to be able to read any messages created (if it wraps them at a weird spot, or something). Maybe this should be configurable or able to be disabled entirely?
Please include the following checklist in your PR:
Bonus points for added automated tests!