Skip to content

Commit

Permalink
Remove TestCoroutineContext.kt completely (#3291)
Browse files Browse the repository at this point in the history
Fixes #3218
  • Loading branch information
qwwdfsad committed May 23, 2022
1 parent 8cdb4d6 commit 59488d1
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 302 deletions.
4 changes: 0 additions & 4 deletions kotlinx-coroutines-core/README.md
Expand Up @@ -83,10 +83,6 @@ Select expression to perform multiple suspending operations simultaneously until

Low-level primitives for finer-grained control of coroutines.

# Package kotlinx.coroutines.test

Obsolete and deprecated module to test coroutines. Replaced with `kotlinx-coroutines-test` module.

<!--- MODULE kotlinx-coroutines-core -->
<!--- INDEX kotlinx.coroutines -->

Expand Down
33 changes: 0 additions & 33 deletions kotlinx-coroutines-core/api/kotlinx-coroutines-core.api
Expand Up @@ -1299,36 +1299,3 @@ public final class kotlinx/coroutines/sync/SemaphoreKt {
public static final fun withPermit (Lkotlinx/coroutines/sync/Semaphore;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class kotlinx/coroutines/test/TestCoroutineContext : kotlin/coroutines/CoroutineContext {
public fun <init> ()V
public fun <init> (Ljava/lang/String;)V
public synthetic fun <init> (Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun advanceTimeBy (JLjava/util/concurrent/TimeUnit;)J
public static synthetic fun advanceTimeBy$default (Lkotlinx/coroutines/test/TestCoroutineContext;JLjava/util/concurrent/TimeUnit;ILjava/lang/Object;)J
public final fun advanceTimeTo (JLjava/util/concurrent/TimeUnit;)V
public static synthetic fun advanceTimeTo$default (Lkotlinx/coroutines/test/TestCoroutineContext;JLjava/util/concurrent/TimeUnit;ILjava/lang/Object;)V
public final fun assertAllUnhandledExceptions (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun assertAllUnhandledExceptions$default (Lkotlinx/coroutines/test/TestCoroutineContext;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public final fun assertAnyUnhandledException (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun assertAnyUnhandledException$default (Lkotlinx/coroutines/test/TestCoroutineContext;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public final fun assertExceptions (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun assertExceptions$default (Lkotlinx/coroutines/test/TestCoroutineContext;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public final fun assertUnhandledException (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun assertUnhandledException$default (Lkotlinx/coroutines/test/TestCoroutineContext;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public final fun cancelAllActions ()V
public fun fold (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;
public fun get (Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext$Element;
public final fun getExceptions ()Ljava/util/List;
public fun minusKey (Lkotlin/coroutines/CoroutineContext$Key;)Lkotlin/coroutines/CoroutineContext;
public final fun now (Ljava/util/concurrent/TimeUnit;)J
public static synthetic fun now$default (Lkotlinx/coroutines/test/TestCoroutineContext;Ljava/util/concurrent/TimeUnit;ILjava/lang/Object;)J
public fun plus (Lkotlin/coroutines/CoroutineContext;)Lkotlin/coroutines/CoroutineContext;
public fun toString ()Ljava/lang/String;
public final fun triggerActions ()V
}

public final class kotlinx/coroutines/test/TestCoroutineContextKt {
public static final fun withTestContext (Lkotlinx/coroutines/test/TestCoroutineContext;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun withTestContext$default (Lkotlinx/coroutines/test/TestCoroutineContext;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
}

3 changes: 1 addition & 2 deletions kotlinx-coroutines-core/build.gradle
Expand Up @@ -274,8 +274,7 @@ tasks.jvmLincheckTest {
}

def commonKoverExcludes =
["kotlinx.coroutines.test.*", // Deprecated package for removal
"kotlinx.coroutines.debug.*", // Tested by debug module
["kotlinx.coroutines.debug.*", // Tested by debug module
"kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.*", // Deprecated
"kotlinx.coroutines.scheduling.LimitingDispatcher", // Deprecated
"kotlinx.coroutines.scheduling.ExperimentalCoroutineDispatcher" // Deprecated
Expand Down
260 changes: 0 additions & 260 deletions kotlinx-coroutines-core/jvm/src/test_/TestCoroutineContext.kt

This file was deleted.

Expand Up @@ -77,9 +77,6 @@ public class CoroutinesBlockHoundIntegration : BlockHoundIntegration {
for (method in listOf("clear", "peek", "removeFirstOrNull", "addLast")) {
allowBlockingCallsInside("kotlinx.coroutines.internal.ThreadSafeHeap", method)
}
// [addLastIf] is only used in [EventLoop.common]. Users of [removeFirstIf]:
allowBlockingCallsInside("kotlinx.coroutines.test.TestCoroutineDispatcher", "doActionsUntil")
allowBlockingCallsInside("kotlinx.coroutines.test.TestCoroutineContext", "triggerActions")
}

private fun BlockHound.Builder.allowBlockingCallsInFlow() {
Expand Down

0 comments on commit 59488d1

Please sign in to comment.