Files
kotlin-fork/backend.native/tests/codegen/cycles/cycle.kt
T
2017-10-20 18:25:05 +03:00

17 lines
248 B
Kotlin

package codegen.cycles.cycle
import kotlin.test.*
fun cycle(cnt: Int): Int {
var sum = 1
while (sum == cnt) {
sum = sum + 1
}
return sum
}
@Test fun runTest() {
if (cycle(1) != 2) throw Error()
if (cycle(0) != 1) throw Error()
}