diff options
author | Allan Wang <me@allanwang.ca> | 2019-05-01 17:05:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-01 17:05:22 -0700 |
commit | e7a499f6314f8d6345b19c3e221f3cd9cd176d4f (patch) | |
tree | a19cbd9b60a218cdc3370ea83e565fd8ab086881 /app/src/test/kotlin | |
parent | da93672c2ed6b54e0e7119a6b55715185112df3e (diff) | |
parent | 547bf6f932b56a4f66e9eb1d9f175e7db4e4512e (diff) | |
download | frost-e7a499f6314f8d6345b19c3e221f3cd9cd176d4f.tar.gz frost-e7a499f6314f8d6345b19c3e221f3cd9cd176d4f.tar.bz2 frost-e7a499f6314f8d6345b19c3e221f3cd9cd176d4f.zip |
Merge pull request #1416 from AllanWang/misc
Misc
Diffstat (limited to 'app/src/test/kotlin')
-rw-r--r-- | app/src/test/kotlin/com/pitchedapps/frost/utils/CoroutineTest.kt | 10 |
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() -// } } } } |