Comments (7)
@eclipseo - There are known issues surrounding assertions against map[string]interface{}
:
Might this be a duplicate issue?
from assertions.
It doesn't look like it, it is specific to 1.16, 1.15 works.
from assertions.
@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 - 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.
@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.
Looks related to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008443 .
distro : debian/sid
go version : 1.18
from assertions.
from assertions.
Related Issues (20)
- Assertions should allow an optional string with a better message HOT 3
- ShouldEqualJSON only supports JSON Objects at the root HOT 1
- [suggestion] loose slice equality HOT 1
- ShouldBeEmpty should warn if subject has no length
- ShouldEqualJSON does not work with json arrays HOT 4
- Problem running test HOT 1
- httptest.NewServer starts in background goroutine and causes data race when used with shouldNotBeNil (which depends upon string formatting) HOT 3
- building error HOT 2
- Drop go1.17 dependency HOT 2
- Super small typo in documentation of ShouldNotBeBlank
- Versioning scheme changed backwards HOT 3
- TestMapSortRendering fails with go1.18 HOT 1
- map[int64]bool ShouldContainKey didn't work as expected HOT 4
- No function for comparing arrays and ignoring order HOT 4
- ShouldResemble can fail when there's no visual diff between the inputs HOT 1
- The module declares is incorrect HOT 2
- ShouldEqual no longer works with functions HOT 5
- Major version shall be bumped since v1.51.0 HOT 5
- module declares its path as: github.com/smarty/assertions but was required as: github.com/smartystreets/assertions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assertions.