From 07a83a33b878791257d1aa2282e71c1d2f301254 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 2 May 2022 23:21:58 +0530 Subject: chore(deps): update dependency app.cash.turbine:turbine to v0.8.0 (#1890) Co-authored-by: Renovate Bot Co-authored-by: Harsh Shandilya --- .../kotlin/dev/msfjarvis/aps/test/turbine.ext.kt | 37 ---------------------- 1 file changed, 37 deletions(-) delete mode 100644 coroutine-utils-testing/src/main/kotlin/dev/msfjarvis/aps/test/turbine.ext.kt (limited to 'coroutine-utils-testing/src') diff --git a/coroutine-utils-testing/src/main/kotlin/dev/msfjarvis/aps/test/turbine.ext.kt b/coroutine-utils-testing/src/main/kotlin/dev/msfjarvis/aps/test/turbine.ext.kt deleted file mode 100644 index 596be1a1..00000000 --- a/coroutine-utils-testing/src/main/kotlin/dev/msfjarvis/aps/test/turbine.ext.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright © 2014-2022 The Android Password Store Authors. All Rights Reserved. - * SPDX-License-Identifier: GPL-3.0-only - */ - -package dev.msfjarvis.aps.test - -import app.cash.turbine.FlowTurbine -import app.cash.turbine.test -import kotlin.coroutines.coroutineContext -import kotlin.time.Duration -import kotlin.time.Duration.Companion.seconds -import kotlin.time.ExperimentalTime -import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.flowOn -import kotlinx.coroutines.test.TestCoroutineScheduler -import kotlinx.coroutines.test.UnconfinedTestDispatcher - -/** - * Wrapper for [test] that implements compatibility with kotlinx.coroutines 1.6.0 - * - * @see "https://github.com/cashapp/turbine/issues/42#issuecomment-1000317026" - */ -@ExperimentalTime -@ExperimentalCoroutinesApi -public suspend fun Flow.test2( - timeout: Duration = 1.seconds, - validate: suspend FlowTurbine.() -> Unit, -) { - val testScheduler = coroutineContext[TestCoroutineScheduler] - return if (testScheduler == null) { - test(timeout, validate) - } else { - flowOn(UnconfinedTestDispatcher(testScheduler)).test(timeout, validate) - } -} -- cgit v1.2.3