Test framework for inline
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
fun box(): String {
|
||||
val result = runTest{minByTest<Int> { it }}
|
||||
|
||||
if (result != 1) return "test1: ${result}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
public inline fun <R> runTest(f: () -> R): R {
|
||||
return f()
|
||||
}
|
||||
|
||||
public inline fun <R> minByTest(f: (Int) -> R): R {
|
||||
var minValue = f(1)
|
||||
val v = f(1)
|
||||
return v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user