Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure output: avoid using the 'same as' logic for suppressed values #163

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

frankban
Copy link
Owner

For a DeepEquals test, you could have an output like:

error:
  values are not deep equal
diff (-got +want):
    []any{
            struct{ Strings []any; Ints []int }{Strings: {string("who"), string("dalek")}, Ints: {42}},
            string("extra line 1"),
  -         string("extra line 2"),
  -         string("extra line 3"),
    }
got:
  <suppressed due to length (11 lines), use -v for full output>
want:
  <same as got>

I've found the <same as got> in this case a bit confusing, as it seems to refer more to the actual value, rather than the suppressed message.

With this branch, the output is now more explicit:

error:
  values are not deep equal
diff (-got +want):
    []any{
            struct{ Strings []any; Ints []int }{Strings: {string("who"), string("dalek")}, Ints: {42}},
            string("extra line 1"),
  -         string("extra line 2"),
  -         string("extra line 3"),
    }
got:
  <suppressed due to length (11 lines), use -v for full output>
want:
  <suppressed due to length (11 lines), use -v for full output>

Copy link

@TeodorPt TeodorPt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@frankban frankban merged commit dfe325a into master Aug 1, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants