All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.mockk.impl.InternalPlatform.kt Maven / Gradle / Ivy

package io.mockk.impl

import io.mockk.StackElement
import kotlin.reflect.KClass

expect object InternalPlatform {
    fun time(): Long

    fun ref(obj: Any): Ref

    fun hkd(obj: Any): String

    fun isPassedByValue(cls: KClass<*>): Boolean

    fun  MutableMap.customComputeIfAbsent(key: K, valueFunc: (K) -> V): V

    fun  weakMap(): MutableMap

    fun  identityMap(): MutableMap

    fun  synchronizedMutableList(): MutableList

    fun  synchronizedMutableMap(): MutableMap

    fun packRef(arg: Any?): Any?

    fun prettifyRecordingException(ex: Throwable): Throwable

    fun  copyFields(to: T, from: T)

    fun captureStackTrace(): () -> List

    fun weakRef(value: Any): WeakRef

    fun multiNotifier(): MultiNotifier

    inline fun  synchronized(obj: Any, block: () -> T): T
}

interface Ref {
    val value: Any
}

interface WeakRef {
    val value: Any?
}

interface MultiNotifier {
    fun notify(key: Any)

    fun openSession(keys: List, timeout: Long): Session

    interface Session {
        fun wait(): Boolean

        fun close()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy