Repository navigation
Reverse "want" and "got" in test failures - #279
Merged
Merged
Conversation
Owner
|
Uhm, you're right! I never realized the test was the opposite. |
Contributor
Author
|
The failure (seen here) is unrelated to this commit... but it prevents tests from running. Would you like a separate PR to fix that? |
Owner
|
Ah yes, please. If you have a minute this would be helpful. |
Suppose we have a rule configured to label messages with
"oops-bad-label", and a test that checks they're labeled with
"yep-correct-label". So before this change you would get:
--- want
+++ got
...
"labels": [
- "oops-bad-label"
+ "yep-correct-label"
]
To make this match the usual logic of automated testing (especially Go's
"want" and "got"), we would like the "want" section to be "what the test
describes should happen". Therefore, with this change, we get this
output:
--- want
+++ got
...
"labels": [
- "yep-correct-label"
+ "oops-bad-label"
]
lutzky
force-pushed
the
reverse-test-error
branch
from
August 11, 2022 08:57
d22aea5 to
83f71f5
Compare
Contributor
Author
|
I've done it as a separate commit within this PR, LMK if you want it in a separate PR. |
Owner
|
That's totally fine. Thanks a lot! |
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.
Suppose we have a rule configured to label messages with
oops-bad-label, and a test that checks they're labeled withyep-correct-label. So before this change you would get:To make this match the usual logic of automated testing (especially Go's "want" and "got"), we would like the "want" section to be "what the test describes should happen". Therefore, with this change, we get this output: