Skip to content

Commit f7d0177

Browse files
committed
Fixed ChannelReceiveOrClosedTest.testToString on JS
1 parent fd6a5bf commit f7d0177

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kotlinx-coroutines-core/common/test/channels/ChannelReceiveOrClosedTest.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,11 @@ class ChannelReceiveOrClosedTest : TestBase() {
125125
fun testToString() = runTest {
126126
val channel = Channel<String>(1)
127127
channel.send("message")
128-
channel.close(TestException1())
128+
channel.close(TestException1("OK"))
129129
assertEquals("Value(message)", channel.receiveOrClosed().toString())
130130
// toString implementation for exception differs on every platform
131131
val str = channel.receiveOrClosed().toString()
132-
assertTrue(str.matches("Closed\\(.*TestException1\\)".toRegex()))
132+
if (!str.matches("Closed\\(.*TestException1: OK\\)".toRegex()))
133+
error("Unexpected string: '$str'")
133134
}
134135
}

0 commit comments

Comments
 (0)