-
Couldn't load subscription status.
- Fork 1.4k
Add test for ZStream.fromIterator about exceptional case
#10062
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
Conversation
69c9ff5 to
721902a
Compare
Fatal errors should not be caught. |
721902a to
a6b4998
Compare
a6b4998 to
147ec9c
Compare
| } | ||
| }, | ||
| test("handles exceptions from iterator") { | ||
| check(Gen.small(Gen.const(_), min = 1)) { maxChunkSize => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do either of these tests need Gen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic is different when maxChunkSize == 1 and maxChunkSize > 1 so it needs to test these 2 cases, which justifies the usage of Gen.
It's copied from the initial test testing fromIterator
| def failingIterator = { | ||
| throw exception | ||
|
|
||
| List(1, 2).iterator | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could simplify this to just throw + type annotation.
I didn't manage to add a case for a fatal error as I didn't manage to cactch the fatal error. No idea why
Needed for: #10060