test: Utility to compare two lists of documents for equality #6005
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.
Related Issues
contains_same_docs
always returnedTrue
if the two input lists of documents had the same length. This happened because the implementation uses the return value ofsort
instead ofsorted
.Four tests using the utility were actually broken due to issues in the implementation of the tests.
Proposed Changes:
sorted
instead ofsort
, which returns the sorted list so that it can be compared to the other sorted list of documents.-2
and float-2.0
for equality.How did you test it?
Manual tests for the
contains_same_docs
. It's a small utility function ofDocumentStoreBaseTests
and I didn't want to add tests for it.Updated unit tests.
Notes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.