Giter Site home page Giter Site logo

Comments (7)

mdwhatcott avatar mdwhatcott commented on August 11, 2024

@eclipseo - There are known issues surrounding assertions against map[string]interface{}:

Might this be a duplicate issue?

from assertions.

eclipseo avatar eclipseo commented on August 11, 2024

It doesn't look like it, it is specific to 1.16, 1.15 works.

from assertions.

mdwhatcott avatar mdwhatcott commented on August 11, 2024

@eclipseo - I've tried to replicate the failure with the following test case:

func TestIssue42(t *testing.T) {
	a := map[interface{}]struct {}{1:{}, 2:{}, 3:{}, "foo":{}}
	b := map[interface{}]struct {}{3:{}, 1:{}, 2:{}, "foo":{}}
	New(t).So(a, ShouldResemble, b)
}

Here's the output I'm getting on 64-bit Ubuntu 20.04.1 LTS:

mike@mikewhat:~/code/src/github.com/smartystreets/assertions$ ~/Desktop/go1.16/go/bin/go version
go version go1.16beta1 linux/amd64
mike@mikewhat:~/code/src/github.com/smartystreets/assertions$ ~/Desktop/go1.16/go/bin/go test -v -run TestIssue42
=== RUN   TestIssue42
--- PASS: TestIssue42 (0.00s)
PASS
ok  	github.com/smartystreets/assertions	0.001s

So, I'm not able to replicate. Did I get the test right? (does the above test case fail on your system?) Or is this failure specific to your architecture?

from assertions.

eclipseo avatar eclipseo commented on August 11, 2024

@eclipseo - I've tried to replicate the failure with the following test case:

func TestIssue42(t *testing.T) {
	a := map[interface{}]struct {}{1:{}, 2:{}, 3:{}, "foo":{}}
	b := map[interface{}]struct {}{3:{}, 1:{}, 2:{}, "foo":{}}
	New(t).So(a, ShouldResemble, b)
}

Here's the output I'm getting on 64-bit Ubuntu 20.04.1 LTS:

mike@mikewhat:~/code/src/github.com/smartystreets/assertions$ ~/Desktop/go1.16/go/bin/go version
go version go1.16beta1 linux/amd64
mike@mikewhat:~/code/src/github.com/smartystreets/assertions$ ~/Desktop/go1.16/go/bin/go test -v -run TestIssue42
=== RUN   TestIssue42
--- PASS: TestIssue42 (0.00s)
PASS
ok  	github.com/smartystreets/assertions	0.001s

So, I'm not able to replicate. Did I get the test right? (does the above test case fail on your system?) Or is this failure specific to your architecture?

I have no issue with other arches, only on s390x, which is tricky to test as it's on a CI system I don't have access to. It's probably a change made to Go dusing the 1.16 window but I haven't been able to find any clue in the commit log. Maybe I should report to upstream Go with your testcase is I manage to reproduce it.

(Full log https://koji.fedoraproject.org/koji/taskinfo?taskID=60502076)

from assertions.

mdwhatcott avatar mdwhatcott commented on August 11, 2024

@eclipseo - Yeah, it very well could be an issue with Go that should be reported. But you'll probably need to come up with code to reproduce the problem but ideally that code would be independent of this library. Can you isolate the change to a single method call in the ShouldResemble behavior? For instance, is it the call to reflect.DeepEqual() (or maybe somewhere close to that)?

from assertions.

openarun avatar openarun commented on August 11, 2024

Looks related to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008443 .
distro : debian/sid
go version : 1.18

from assertions.

openarun avatar openarun commented on August 11, 2024

#47

from assertions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.