aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/utils/CoroutineTest.kt10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/utils/CoroutineTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/utils/CoroutineTest.kt
index e93f507c..5cde7323 100644
--- a/app/src/test/kotlin/com/pitchedapps/frost/utils/CoroutineTest.kt
+++ b/app/src/test/kotlin/com/pitchedapps/frost/utils/CoroutineTest.kt
@@ -246,6 +246,8 @@ class CoroutineTest {
}
}
+ class TestException(msg: String) : RuntimeException(msg)
+
@Test
fun exceptionChecks() {
val mainTag = "main-test"
@@ -257,7 +259,7 @@ class CoroutineTest {
val job = SupervisorJob()
val flyweight = Flyweight<Int, Int>(GlobalScope, 200L) {
- throw java.lang.RuntimeException("Flyweight exception")
+ throw TestException("Flyweight exception")
}
suspend fun crash(): Boolean = withContext(Dispatchers.IO) {
@@ -266,7 +268,7 @@ class CoroutineTest {
flyweight.fetch(0).await()
}
true
- } catch (e: java.lang.Exception) {
+ } catch (e: TestException) {
false
}
}
@@ -282,10 +284,6 @@ class CoroutineTest {
println("B")
channel.offer(1)
}
-// launch {
-// delay(2000)
-// job.cancel()
-// }
}
}
}