Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds some fixes to the list equality logic.
Remove the early return statement inside
CqlList.equal
leading to e.g. this being true:{{'a','b'}, 'c'} = {{'a','b'},'d'}
. Added theEqualWithSubListsTrue
andEqualWithSubListsFalse
tests for this case.Fix null handling ("For list types, this means that equality returns true if and only if the lists contain elements of the same type, have the same number of elements, and for each element in the lists, in order, the elements are equal using equality semantics, with the exception that null elements are considered equal." - link). Added the
EqualLiteralNull
test to better cover this case.The
EqualNullNull
test (XML-based) is adjusted to match the spec. The same change is proposed in Fix expected output for the EqualNullNull test cql-tests#38.The
test_Equal_BothListsHaveNull
test (library-based) is also fixed to match the spec.Because our XML-based tests use CQL's equality semantics to compare the expected to actual value of test expressions, it's now possible to un-skip the
FlattenListNullAndNull
test which previously wasn't passing because{ null, null } = { null, null }
didn't evaluate totrue
.