Closed keisuke713 closed 8 months ago
hey @keisuke713 you can use BeComparableTo()
- this uses go-cmp under the hood and will give you a useful diff:
[FAILED] Expected object to be comparable, diff: map[string]string{
"key1": "value1",
- "key2": "value2",
+ "key2": "value22",
}
@onsi It works as I expected! thanks!
Is there a matcher that check if two maps are equal? What I wanna to do is comparison of two maps, and if they do not hold the exact same key value pair, then display difference like below
I think gomega seems not to have such matcher, which provides detailed difference between two maps. Therefore, in my project, I gonna create custom matcher that suit my above need, but if any matcher, could you let me know about it.
Best Regard.