-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add tests for Channel closed with an exception #4517
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
base: develop
Are you sure you want to change the base?
Conversation
| } | ||
| } | ||
|
|
||
| /** |
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.
This syntax means the comment is a KDoc and refers to the entity directly below it. To make this a normal multiline comment for separating groups of tests, use /*.
That said, I think the separation is easy to break accidentally. Why not introduce separate classes to make this more robust?
class ClosedChannelTest: TestBase() {
/**
* Properties.
*
* Properties stay the same regardless of whether the channel was closed with or without exception.
*/
class PropertiesTests: TestBase() {
}
}|
|
||
| @Test | ||
| fun testIteratorClosedHasNextFalse() = runTest { | ||
| TestChannelKind.entries.forEach { kind -> |
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.
Proposal:
fun TestChannelKind.Companion.runTestForEach(
testBody: suspend CoroutineScope.(TestChannelKind) -> Unit
): TestResult = runTest {
TestChannelKind.entries.forEach { kind ->
testBody(kind)
}
}May be more convenient, with how often this pattern occurs.
No description provided.