JS: move inline test to box tests

This commit is contained in:
Alexey Andreev
2016-08-29 11:55:22 +03:00
parent b159049be8
commit efb82a044f
150 changed files with 1417 additions and 1430 deletions
@@ -0,0 +1,24 @@
// See KT-8005
package foo
private inline fun bar(predicate: (Char) -> Boolean): Int {
var i = 0
val str = "abc "
while (predicate(str[i]) && i < 3) {
i++
}
return i
}
private fun test(c: Char): Int {
return bar { it != c }
}
fun box(): String {
assertEquals(0, test('a'))
assertEquals(1, test('b'))
assertEquals(2, test('c'))
assertEquals(3, test('*'))
return "OK"
}