When two sets are compared I would like to see the mutual exclusive values in the output. See new lines 'excl: ...' ``` Condition not satisfied: oneSet == anotherSet | | | | | [3, 6, 4, 5] | | excl: [6] | false [4, 3, 1, 5, 2] excl: [1,2] ``` Used sample feature: ```groovy def "sets are equal"() { given: Set oneSet = [4,3,1,5,1,4,2] Set anotherSet = [3,6,4,3,5] expect: oneSet == anotherSet } ```
Activity
masooh commentedon Sep 28, 2018
Here's another approach for rendering the differences (like in String comparison):
This would require to sort the sets for rendering.
leonard84 commentedon Sep 28, 2018
Interesting suggestion, another possibility could be:
The relevant code is located here
org.spockframework.runtime.ExpressionInfoValueRenderer#doRenderValue.tylerbenson commentedon Sep 28, 2018
💯 This would be awesome! Could potentially be useful for other types of collections too (lists and maps).
Add special rendering for Set comparisons
leonard84 commentedon Sep 29, 2018
@tylerbenson lists and maps will are more difficult, since order or values are relevant as well.
Add special rendering for Set comparisons
Add special rendering for Set comparisons (#925)