Ensure that assert.Fail properly align its output#364
Merged
Conversation
fdfb958 to
cba8584
Compare
Previous implementation depended on tab alignment. This worked when the output was not prepended with anything, but would break if the output was prepended with further spaces (which can occur in environments like IntelliJ test runners). This commit fixes it so that the output is always aligned logically. Fixes stretchr#83
cba8584 to
ddb91ee
Compare
Contributor
Author
Contributor
Author
|
Note that this PR also makes it such that the "Messages" output is aligned, which is a behavior change. I believe this behavior is more conceptually correct and looks nicer, but that can be done as a separate discussion/PR if there's contention around that (whereas making sure the alignment is consistent between terminal and runner output is indisputably a bug that should be fixed). @ernesto-jimenez (or any other project maintainers), please let me know if you have any feedback. |
Contributor
Author
|
@ernesto-jimenez any feedback? This PR is getting fairly stale and would like to know whether it can move forward (or if it needs to be modified). |
Member
|
@nmiyake finally had some time to review it. Looks good, merging it now :) |
jonnyreeves
pushed a commit
to jonnyreeves/testify
that referenced
this pull request
Jan 5, 2017
Ensure that assert.Fail properly align its output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Previous implementation depended on tab alignment. This worked
when the output was not prepended with anything, but would break
if the output was prepended with further spaces (which can occur
in environments like IntelliJ test runners). This commit fixes it
so that the output is always aligned logically.
Fixes #83