Forum Discussion
HimanshuTayal
Community Hero
try to compare single item at once, hope you will find the error that way.
JHunt
6 years agoCommunity Hero
Use in only to compare single items from a list. Use equals to compare the whole list, or assert that each item from the first list is in the second list.
def a = [1,2] def b = [1,2,3] def c = [[1,2],3] def d = [1,2] assert (a in c) assert !(a in b) a.each { assert it in b } assert a == d