forked from mockk/mockk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InternalPlatform.kt
58 lines (35 loc) · 1.13 KB
/
InternalPlatform.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
53
54
55
56
57
58
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 <K, V> MutableMap<K, V>.customComputeIfAbsent(key: K, valueFunc: (K) -> V): V
fun <K, V> weakMap(): MutableMap<K, V>
fun <K, V> identityMap(): MutableMap<K, V>
fun <T> synchronizedMutableList(): MutableList<T>
fun <K, V> synchronizedMutableMap(): MutableMap<K, V>
fun packRef(arg: Any?): Any?
fun prettifyRecordingException(ex: Throwable): Throwable
fun <T : Any> copyFields(to: T, from: T)
fun captureStackTrace(): () -> List<StackElement>
fun weakRef(value: Any): WeakRef
fun multiNotifier(): MultiNotifier
inline fun <T> 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<Any>, timeout: Long): Session
interface Session {
fun wait(): Boolean
fun close()
}
}