Attempt on fixing tests

This commit is contained in:
kildishevps 2024-12-31 05:43:13 +03:00
parent db219a351f
commit f548a162e7
6 changed files with 20 additions and 22 deletions

View File

@ -18,10 +18,8 @@
@file:Suppress("UnstableApiUsage") @file:Suppress("UnstableApiUsage")
import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
plugins { plugins {

View File

@ -36,6 +36,6 @@ fun testBlocking(block : suspend () -> Unit) {
block.startCoroutine(continuation) block.startCoroutine(continuation)
} }
expect fun runTest(block: suspend (scope : CoroutineScope) -> Unit) fun runTest(block: suspend (scope : CoroutineScope) -> Unit) = kotlinx.coroutines.test.runTest { block(this) }

View File

@ -1,7 +1,7 @@
package com.ionspin.kotlin.crypto.util package com.ionspin.kotlin.crypto.util
import kotlinx.coroutines.CoroutineScope //import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.GlobalScope //import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.promise //import kotlinx.coroutines.promise
//
actual fun runTest(block: suspend (scope : CoroutineScope) -> Unit): dynamic = GlobalScope.promise { block(this) } //actual fun runTest(block: suspend (scope : CoroutineScope) -> Unit): dynamic = GlobalScope.promise { block(this) }

View File

@ -1,7 +1,7 @@
package com.ionspin.kotlin.crypto.util package com.ionspin.kotlin.crypto.util
import kotlinx.coroutines.CoroutineScope //import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.runBlocking //import kotlinx.coroutines.runBlocking
//
actual fun runTest(block: suspend (scope : CoroutineScope) -> Unit) = runBlocking { block(this) } //actual fun runTest(block: suspend (scope : CoroutineScope) -> Unit) = runBlocking { block(this) }

View File

@ -1,7 +1,7 @@
package com.ionspin.kotlin.crypto.util package com.ionspin.kotlin.crypto.util
import kotlinx.coroutines.CoroutineScope //import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.runBlocking //import kotlinx.coroutines.runBlocking
//
actual fun runTest(block: suspend (scope : CoroutineScope) -> Unit) = runBlocking { block(this) } //actual fun runTest(block: suspend (scope : CoroutineScope) -> Unit) = runBlocking { block(this) }

View File

@ -1,10 +1,10 @@
package com.ionspin.kotlin.crypto.util package com.ionspin.kotlin.crypto.util
import kotlinx.coroutines.CoroutineScope //import kotlinx.coroutines.CoroutineScope
actual fun runTest(block: suspend (scope : CoroutineScope) -> Unit) { //actual fun runTest(block: suspend (scope : CoroutineScope) -> Unit) {
kotlinx.coroutines.test.runTest { // kotlinx.coroutines.test.runTest {
block(this) // block(this)
} // }
} //}