You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: kotlinx-coroutines-test/api/kotlinx-coroutines-test.api
+10-3
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ public final class kotlinx/coroutines/test/TestCoroutineDispatcher : kotlinx/cor
51
51
52
52
public final class kotlinx/coroutines/test/TestCoroutineExceptionHandler : kotlin/coroutines/AbstractCoroutineContextElement, kotlinx/coroutines/CoroutineExceptionHandler, kotlinx/coroutines/test/UncaughtExceptionCaptor {
53
53
public fun <init> ()V
54
-
public fun cleanupTestCoroutinesCaptor ()V
54
+
public fun cleanupTestCoroutines ()V
55
55
public fun getUncaughtExceptions ()Ljava/util/List;
56
56
public fun handleException (Lkotlin/coroutines/CoroutineContext;Ljava/lang/Throwable;)V
57
57
}
@@ -68,9 +68,10 @@ public final class kotlinx/coroutines/test/TestCoroutineScheduler : kotlin/corou
68
68
public final class kotlinx/coroutines/test/TestCoroutineScheduler$Key : kotlin/coroutines/CoroutineContext$Key {
69
69
}
70
70
71
-
public abstract interface class kotlinx/coroutines/test/TestCoroutineScope : kotlinx/coroutines/CoroutineScope, kotlinx/coroutines/test/UncaughtExceptionCaptor {
71
+
public abstract interface class kotlinx/coroutines/test/TestCoroutineScope : kotlinx/coroutines/CoroutineScope {
72
72
public abstract fun cleanupTestCoroutines ()V
73
73
public abstract fun getTestScheduler ()Lkotlinx/coroutines/test/TestCoroutineScheduler;
74
+
public abstract fun reportException (Ljava/lang/Throwable;)V
74
75
}
75
76
76
77
public final class kotlinx/coroutines/test/TestCoroutineScopeKt {
@@ -81,6 +82,7 @@ public final class kotlinx/coroutines/test/TestCoroutineScopeKt {
81
82
public static final fun createTestCoroutineScope (Lkotlin/coroutines/CoroutineContext;)Lkotlinx/coroutines/test/TestCoroutineScope;
82
83
public static synthetic fun createTestCoroutineScope$default (Lkotlin/coroutines/CoroutineContext;ILjava/lang/Object;)Lkotlinx/coroutines/test/TestCoroutineScope;
83
84
public static final fun getCurrentTime (Lkotlinx/coroutines/test/TestCoroutineScope;)J
85
+
public static final fun getUncaughtExceptions (Lkotlinx/coroutines/test/TestCoroutineScope;)Ljava/util/List;
84
86
public static final fun pauseDispatcher (Lkotlinx/coroutines/test/TestCoroutineScope;)V
85
87
public static final fun pauseDispatcher (Lkotlinx/coroutines/test/TestCoroutineScope;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
86
88
public static final fun resumeDispatcher (Lkotlinx/coroutines/test/TestCoroutineScope;)V
@@ -100,8 +102,13 @@ public final class kotlinx/coroutines/test/TestDispatchers {
100
102
public static final fun setMain (Lkotlinx/coroutines/Dispatchers;Lkotlinx/coroutines/CoroutineDispatcher;)V
101
103
}
102
104
105
+
public final class kotlinx/coroutines/test/TestExceptionHandlerKt {
106
+
public static final fun TestExceptionHandler (Lkotlinx/coroutines/test/TestCoroutineScope;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/CoroutineExceptionHandler;
107
+
public static synthetic fun TestExceptionHandler$default (Lkotlinx/coroutines/test/TestCoroutineScope;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/CoroutineExceptionHandler;
108
+
}
109
+
103
110
public abstract interface class kotlinx/coroutines/test/UncaughtExceptionCaptor {
104
-
public abstract fun cleanupTestCoroutinesCaptor ()V
111
+
public abstract fun cleanupTestCoroutines ()V
105
112
public abstract fun getUncaughtExceptions ()Ljava/util/List;
Copy file name to clipboardExpand all lines: kotlinx-coroutines-test/common/src/TestCoroutineExceptionHandler.kt
+19-10
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,16 @@ import kotlin.coroutines.*
11
11
/**
12
12
* Access uncaught coroutine exceptions captured during test execution.
13
13
*/
14
-
@ExperimentalCoroutinesApi
14
+
@Deprecated(
15
+
"Consider whether a `TestExceptionHandler` would work instead. If not, please report your use case at https://github.com/Kotlin/kotlinx.coroutines/issues.",
16
+
level =DeprecationLevel.WARNING
17
+
)
15
18
publicinterfaceUncaughtExceptionCaptor {
16
19
/**
17
20
* List of uncaught coroutine exceptions.
18
21
*
19
22
* The returned list is a copy of the currently caught exceptions.
20
-
* During [cleanupTestCoroutinesCaptor] the first element of this list is rethrown if it is not empty.
23
+
* During [cleanupTestCoroutines] the first element of this list is rethrown if it is not empty.
21
24
*/
22
25
publicval uncaughtExceptions:List<Throwable>
23
26
@@ -29,33 +32,39 @@ public interface UncaughtExceptionCaptor {
29
32
*
30
33
* @throws Throwable the first uncaught exception, if there are any uncaught exceptions.
31
34
*/
32
-
publicfuncleanupTestCoroutinesCaptor()
35
+
publicfuncleanupTestCoroutines()
33
36
}
34
37
35
38
/**
36
39
* An exception handler that captures uncaught exceptions in tests.
37
40
*/
38
-
@ExperimentalCoroutinesApi
41
+
@Deprecated("You can use `TestExceptionHandler` to define an exception handler that is linked to "+
42
+
"a `TestCoroutineScope`, or define your own `CoroutineExceptionHandler` if you just need to handle uncaught "+
43
+
"exceptions without a special `TestCoroutineScope` integration.", level =DeprecationLevel.WARNING)
0 commit comments