Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Better output when Unexpected call #501

Closed
lovung opened this issue Nov 24, 2020 · 1 comment
Closed

Better output when Unexpected call #501

lovung opened this issue Nov 24, 2020 · 1 comment

Comments

@lovung
Copy link
Contributor

lovung commented Nov 24, 2020

Requested feature

  • Should have better output when having Unexpected call
  • Can see the diff between Got and Want on EXPECT()

Why the feature is needed
Currently, I have some output like that. It's hard to see what is wrong.

|| Got: {{0 01ENSP2J4H9QRMWYJ3ZQTYEGYJ 0001-01-01 00:00:00 +0000 UTC {0001-01-01 00:00:00 +0000 UTC false} 2020-10-10 00:00:00 +0000 UTC <nil>} 0 <nil> 0 name namekana code 123 50 20 {0 63737366400 <nil>} {0 63737452800 <nil>} {0 0 <nil>} 1000 1 0  0 <nil>     11 10 0 0 0 20 10 0 0 0 21 10 0 0 0 0 0   0 0 [{0 01ENSP2J4H9QRMWYJ3ZQTYEGYJ}] [] [] []  <nil> <nil> [] []  {0  0001-01-01 00:00:00 +0000 UTC <nil> 0 0001-01-01 00:00:00 +0000 UTC 0 {0001-01-01 00:00:00 +0000 UTC false} <nil> 0 {0 0           0 0        0    false false false false false false false false false     false false  0  0001-01-01 00:00:00 +0000 UTC 0 0001-01-01 00:00:00 +0000 UTC 0}      [] [] } {0 0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC 0 0 0   0 0  0  0    } <nil> {{0  }} {{0  }} {{0  }} {{0  }} {{0  }} {{0  }} {{0  }} {{0  }}}
|| Want: is equal to {{0 01ENSP2J4H9QRMWYJ3ZQTYEGYJ 0001-01-01 00:00:00 +0000 UTC {0001-01-01 00:00:00 +0000 UTC false} 2020-10-10 00:00:00 +0000 UTC <nil>} 0 <nil> 0 name namekana code 123 50 50 {0 63737366400 <nil>} {0 63737452800 <nil>} {0 0 <nil>} 1000 1 0  0 <nil>     11 10 0 0 0 20 10 0 0 0 21 10 0 0 0 0 0   0 0 [] [] [] []  <nil> <nil> [] []  {0  0001-01-01 00:00:00 +0000 UTC <nil> 0 0001-01-01 00:00:00 +0000 UTC 0 {0001-01-01 00:00:00 +0000 UTC false} <nil> 0 {0 0           0 0        0    false false false false false false false false false     false false  0  0001-01-01 00:00:00 +0000 UTC 0 0001-01-01 00:00:00 +0000 UTC 0}      [] [] } {0 0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC 0 0 0   0 0  0  0    } <nil> {{0  }} {{0  }} {{0  }} {{0  }} {{0  }} {{0  }} {{0  }} {{0  }}}

Proposed solution

  • Using cmp.Diff for output
@codyoss
Copy link
Member

codyoss commented Dec 10, 2020

Thanks for the report, closing as a duplicate of #265.

@codyoss codyoss closed this as completed Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants