Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.11, 2.4.5
-
None
-
Mac OS X 10.9.5
Oracle Java 1.8.0_60
Description
When I compare two lists with intersect and both lists contain maps I do not get any results, even if the contents are equivalent. The test fails in Groovy 2.3.11, but passes in 2.3.7.
import org.junit.Test class IntersectTest { @Test void testIntersect() { def list1 = [[language: 'Java'], [language: 'Groovy'], [language: 'Scala']] def list2 = [[language: 'Groovy'], [language: 'JRuby'], [language: 'Java']] def intersection = list1.intersect(list2) assert list1[0] == list2[2] // proves that there should be intersecting values println "Intersection: $intersection" assert intersection == [[language: 'Groovy'], [language: 'Java']] } }
The intersect call returns an empty list in 2.3.11, resulting in the following output:
Intersection: [] Assertion failed: assert intersection == [[language: 'Groovy'], [language: 'Java']] | | [] false
Attachments
Issue Links
- is related to
-
GROOVY-7530 disjoint() does not work correctly if objects don't implement Comparable
- Closed