Skip to content

Commit 5fb56f4

Browse files
yorickhenningelizarov
authored andcommitted
Added a test checking future {}'s throw on LAZY.
No production code changes.
1 parent 9a62f27 commit 5fb56f4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

integration/kotlinx-coroutines-guava/test/ListenableFutureTest.kt

+11
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,17 @@ class ListenableFutureTest : TestBase() {
127127
}
128128
}
129129

130+
@Test
131+
fun testFutureLazyStartThrows() {
132+
expect(1)
133+
val e = assertFailsWith<IllegalArgumentException> {
134+
GlobalScope.future(start = CoroutineStart.LAZY) {}
135+
}
136+
137+
assertThat(e.message, IsEqual("LAZY start is not supported"))
138+
finish(2)
139+
}
140+
130141
@Test
131142
fun testCompletedDeferredAsListenableFuture() = runBlocking {
132143
expect(1)

0 commit comments

Comments
 (0)