gmailctl icon indicating copy to clipboard operation
gmailctl copied to clipboard

Reverse "want" and "got" in test failures

Open lutzky opened this issue 3 years ago • 1 comments

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 avatar Aug 10 '22 13:08 lutzky

Uhm, you're right! I never realized the test was the opposite.

mbrt avatar Aug 10 '22 14:08 mbrt

The failure (seen here) is unrelated to this commit... but it prevents tests from running. Would you like a separate PR to fix that?

lutzky avatar Aug 10 '22 21:08 lutzky

Ah yes, please. If you have a minute this would be helpful.

mbrt avatar Aug 11 '22 08:08 mbrt

I've done it as a separate commit within this PR, LMK if you want it in a separate PR.

lutzky avatar Aug 11 '22 08:08 lutzky

That's totally fine. Thanks a lot!

mbrt avatar Aug 11 '22 11:08 mbrt