@@ -26,13 +26,8 @@ abstract class MainDispatcherTestBase: TestBase() {
26
26
/* * Tests the [toString] behavior of [Dispatchers.Main] and [MainCoroutineDispatcher.immediate] */
27
27
@Test
28
28
fun testMainDispatcherToString () {
29
- // TODO: workaround for not having module-info.java for the `test` source set
30
- if (Dispatchers .Main .toString() != " Dispatchers.Main" ) {
31
- throw AssertionError (" Expected Dispatchers.Main, but had ${Dispatchers .Main } " )
32
- }
33
- if (Dispatchers .Main .immediate.toString() != " Dispatchers.Main.immediate" ) {
34
- throw AssertionError (" Expected Dispatchers.Main.immediate, but had ${Dispatchers .Main .immediate} " )
35
- }
29
+ assertEquals(" Dispatchers.Main" , Dispatchers .Main .toString())
30
+ assertEquals(" Dispatchers.Main.immediate" , Dispatchers .Main .immediate.toString())
36
31
}
37
32
38
33
/* * Tests that the tasks scheduled earlier from [MainCoroutineDispatcher.immediate] will be executed earlier,
@@ -54,10 +49,7 @@ abstract class MainDispatcherTestBase: TestBase() {
54
49
/* * Tests that [Dispatchers.Main] and its [MainCoroutineDispatcher.immediate] are treated as different values. */
55
50
@Test
56
51
fun testHandlerDispatcherNotEqualToImmediate () {
57
- // TODO: workaround for not having module-info.java for the `test` source set
58
- if (Dispatchers .Main == Dispatchers .Main .immediate) {
59
- throw AssertionError (" Expected Dispatchers.Main and Dispatchers.Main.immediate not to be equal" )
60
- }
52
+ assertNotEquals(Dispatchers .Main , Dispatchers .Main .immediate)
61
53
}
62
54
63
55
/* * Tests that after a delay, the execution gets back to the main thread. */
0 commit comments