summaryrefslogtreecommitdiff
path: root/coroutine-utils-testing
diff options
context:
space:
mode:
authorrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>2022-05-02 23:21:58 +0530
committerGitHub <noreply@github.com>2022-05-02 23:21:58 +0530
commit07a83a33b878791257d1aa2282e71c1d2f301254 (patch)
tree0c02e2f560049831c6bd095cd1c1a0d3d958b58b /coroutine-utils-testing
parente025b120ed18668418e8cf66830a0590dbc4ab08 (diff)
chore(deps): update dependency app.cash.turbine:turbine to v0.8.0 (#1890)
Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'coroutine-utils-testing')
-rw-r--r--coroutine-utils-testing/src/main/kotlin/dev/msfjarvis/aps/test/turbine.ext.kt37
1 files changed, 0 insertions, 37 deletions
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 <T> Flow<T>.test2(
- timeout: Duration = 1.seconds,
- validate: suspend FlowTurbine<T>.() -> Unit,
-) {
- val testScheduler = coroutineContext[TestCoroutineScheduler]
- return if (testScheduler == null) {
- test(timeout, validate)
- } else {
- flowOn(UnconfinedTestDispatcher(testScheduler)).test(timeout, validate)
- }
-}