On Wed, Jul 26, 2017 at 04:55:39PM +0000, Jan Mercl wrote:
> On Wed, Jul 26, 2017 at 6:37 PM Julian Andres Klode <[email protected]>
> wrote:
> 
> > Is there an existing alternative to reflect.DeepEqual() that also
> respects the shape of the arguments? For example, the following tests fail:
> 
> a and b _are_ of equal shape and contain equal values:
> https://play.golang.org/p/Uam97DXOTy

The structs themselves are, yes. But the entire graph is
different (obviously). 

        A ----- B \
                |-/

vs.    B \
       |-/

Or 2 nodes with 2 edges vs 1 node and 1 edge. There is basically
no practical difference here, but my goal is testing: I have code
that recursively rebuilds some structures (adding more information),
I want to ensure that the resulting graph has the same shape or
structure in my test case, not that they are practically equivalent.

-- 
Debian Developer - deb.li/jak | jak-linux.org - free software dev
                  |  Ubuntu Core Developer |
When replying, only quote what is necessary, and write each reply
directly below the part(s) it pertains to ('inline').  Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to