Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequence.containExactly should work for single pass sequences #2412

Closed
sksamuel opened this issue Aug 13, 2021 · 6 comments · Fixed by #2413
Closed

Sequence.containExactly should work for single pass sequences #2412

sksamuel opened this issue Aug 13, 2021 · 6 comments · Fixed by #2413
Labels
assertions 🔍 Related to the assertion mechanisms within the testing framework. bug 🐛 Issues that report a problem or error in the code.
Milestone

Comments

@sksamuel
Copy link
Member

Which version of Kotest are you using

@sschuberth
Copy link
Member

We're using version 4.6.1, also see this discussion:

The sequence matcher, however, first determines the count of the sequence (which requires a traversal) and afterwards checks the elements (another traversal). This second traversal no longer returns the full sequence, causing the comparison to fail.

@sksamuel
Copy link
Member Author

@sschuberth do you need a fix for 4.6.x or are you ok to wait for 5.0 ?

@sschuberth
Copy link
Member

Thanks for asking. While I have no idea for when 5.0 is planned, I guess it's fine to wait as we can live with the toList() work-around for now.

@sksamuel
Copy link
Member Author

sksamuel commented Aug 13, 2021 via email

@sksamuel sksamuel added this to the 4.6.2 milestone Aug 13, 2021
@sksamuel sksamuel added assertions 🔍 Related to the assertion mechanisms within the testing framework. bug 🐛 Issues that report a problem or error in the code. labels Aug 13, 2021
sksamuel pushed a commit that referenced this issue Aug 15, 2021
…2413)

* #2412 Makes Sequence.containExactly work for single pass sequences

* #2412 Update error message to be display on failure of sequence.containExactly
sksamuel pushed a commit that referenced this issue Aug 24, 2021
…2413)

* #2412 Makes Sequence.containExactly work for single pass sequences

* #2412 Update error message to be display on failure of sequence.containExactly
@sksamuel
Copy link
Member Author

Released in 4.6.2

@sschuberth
Copy link
Member

Thanks a lot!

sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Aug 25, 2021
This is now possible thanks to the fix for [1].

[1]: kotest/kotest#2412

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Aug 26, 2021
This is now possible thanks to the fix for [1].

[1]: kotest/kotest#2412

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assertions 🔍 Related to the assertion mechanisms within the testing framework. bug 🐛 Issues that report a problem or error in the code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants