File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
assertk/src/jvmTest/kotlin/test/assertk Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ package test.assertk
2+
3+ import assertk.assertFailure
4+ import assertk.assertions.hasMessage
5+ import assertk.assertions.isEqualTo
6+ import assertk.assertions.message
7+ import com.willowtreeapps.opentest4k.AssertionFailedError
8+ import kotlinx.coroutines.runBlocking
9+ import test.assertk.assertions.valueOrFail
10+ import kotlin.coroutines.resume
11+ import kotlin.coroutines.suspendCoroutine
12+ import kotlin.test.Test
13+ import kotlin.test.assertEquals
14+ import kotlin.test.assertFailsWith
15+ import kotlin.test.assertFalse
16+ import kotlin.test.assertSame
17+ import kotlin.test.assertTrue
18+
19+ class JVMAssertFailureTest {
20+ @Test
21+ fun can_test_suspending_functions (): Unit = runBlocking {
22+ val t = assertFailsWith<AssertionFailedError > {
23+ assertFailure {
24+ suspendCoroutine { it.resume(Unit ) }
25+ }
26+ }
27+ assertEquals(" expected failure but lambda completed successfully" , t.message)
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments