Skip to content

Conversation

@Guiorgy
Copy link
Contributor

@Guiorgy Guiorgy commented Feb 28, 2024

This fixes an oversight in #9 that didn't account for the possibility that the implementation being tested could return infinite enumeration. This adds a maxCount parameter to the ToSystemEnumerable extension methods that throws an exception (stopping the test) if the SpanEnumerable returns more the specified number of spans.

Note: This assumes that the underlying SpanEnumerable implementation returns spans. This will not detect if the implementation gets stuck in an infinite loop that never returns! Infinite recursions should be caught by the tests once they run out of stack memory.

@dragon7307
Copy link
Member

Why is this a draft pull request to me it looks like it can be emrged?
Also we should drop the last commit as I had already implemented this locally..

@Guiorgy Guiorgy marked this pull request as ready for review February 28, 2024 12:58
@Guiorgy Guiorgy force-pushed the limit-enumeration-in-tests branch from cbace04 to 8c6ed13 Compare February 28, 2024 12:59
@Guiorgy
Copy link
Contributor Author

Guiorgy commented Feb 28, 2024

The draft pull was a missclick, and the reorder commit was removed

@dragon7307
Copy link
Member

dragon7307 commented Feb 28, 2024

Great, merging it

@dragon7307 dragon7307 merged commit 22de2cc into draconware-dev:review-tests Feb 28, 2024
@dragon7307 dragon7307 mentioned this pull request Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants