Files
kotlin-fork/compiler/testData/codegen/box/boxingOptimization/progressions.kt
T
Mikhail Glukhikh e7e80be34a [FIR2IR] Populate overridden symbols even for !isOverride
Before this commit we considered !isOverride as a sign that
function / field / accessor has no overridden symbols.
However, it's false for deserialized, because isOverride
is always false there.

This commit fixes 68 BB tests but breaks 25 BB tests (not yet muted)
2020-05-14 13:40:36 +03:00

35 lines
1.1 KiB
Kotlin
Vendored

// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
import kotlin.test.assertEquals
fun box() : String {
val result1 = (1..100).count { x -> x % 2 == 0 }
val result2 = (1..100).filter { x -> x % 2 == 0 }.size
assertEquals(result1, 50)
assertEquals(result2, 50)
val result3 = (1..100).map { x -> 2 * x }.count { x -> x % 2 == 0 }
val result4 = (1..100).map { x -> 2 * x }.filter { x -> x % 2 == 0 }.size
assertEquals(result3, 100)
assertEquals(result4, 100)
val result5 = (1L..100L).count { x -> x % 2 == 0L }
val result6 = (1L..100L).filter { x -> x % 2 == 0L }.size
assertEquals(result5, 50)
assertEquals(result6, 50)
val result7 = (1L..100L).map { x -> 2 * x }.count { x -> x % 2 == 0L }
val result8 = (1L..100L).map { x -> 2 * x }.filter { x -> x % 2 == 0L }.size
assertEquals(result7, 100)
assertEquals(result8, 100)
val result9 = (0..10).reduce { total, next -> total + next }
val result10 = (0L..10L).reduce { total, next -> total + next }
assertEquals(result9, 55)
assertEquals(result10, 55L)
return "OK"
}