1 /* 2 * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. 3 */ 4 5 package kotlinx.coroutines 6 7 import kotlin.test.* 8 9 class ImmediateDispatcherTest : TestBase() { 10 11 @Test testImmediatenull12 fun testImmediate() = runTest { 13 expect(1) 14 val job = launch { expect(3) } 15 withContext(Dispatchers.Main.immediate) { 16 expect(2) 17 } 18 job.join() 19 finish(4) 20 } 21 22 @Test <lambda>null23 fun testMain() = runTest { 24 expect(1) 25 val job = launch { expect(2) } 26 withContext(Dispatchers.Main) { 27 expect(3) 28 } 29 job.join() 30 finish(4) 31 } 32 } 33