Skip to content

Conversation

@murfel
Copy link
Contributor

@murfel murfel commented Sep 2, 2025

No description provided.

}
}

/**
Copy link
Collaborator

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 ->
Copy link
Collaborator

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.

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.

3 participants