/
InternalPlatformDsl.kt
52 lines (33 loc) · 1.08 KB
/
InternalPlatformDsl.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package io.mockk
import kotlin.coroutines.Continuation
expect object InternalPlatformDsl {
fun identityHashCode(obj: Any): Int
fun <T> runCoroutine(block: suspend () -> T): T
fun Any?.toStr(): String
fun deepEquals(obj1: Any?, obj2: Any?): Boolean
fun unboxChar(value: Any): Any
fun Any.toArray(): Array<*>
fun classForName(name: String): Any
fun dynamicCall(
self: Any,
methodName: String,
args: Array<out Any?>,
anyContinuationGen: () -> Continuation<*>
): Any?
fun dynamicGet(self: Any, name: String): Any?
fun dynamicSet(self: Any, name: String, value: Any?)
fun dynamicSetField(self: Any, name: String, value: Any?)
fun <T> threadLocal(initializer: () -> T): InternalRef<T>
fun counter(): InternalCounter
fun <T> coroutineCall(lambda: suspend () -> T): CoroutineCall<T>
}
interface CoroutineCall<T> {
fun callWithContinuation(continuation: Continuation<*>): T
}
interface InternalRef<T> {
val value: T
}
interface InternalCounter {
val value: Long
fun increment(): Long
}