Add tests for mapping operations

This commit is contained in:
Vitaliy.Bibaev
2017-12-21 10:18:48 +03:00
committed by Yan Zhulanow
parent 5383ec50d2
commit b31db50ba1
5 changed files with 38 additions and 0 deletions
@@ -0,0 +1,7 @@
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package map
fun main(args: Array<String>) {
// Breakpoint!
doubleArrayOf(1.0, 2.0).asSequence().map { it * it }.contains(3.0)
}
@@ -0,0 +1,6 @@
package map
fun main(args: Array<String>) {
// Breakpoint!
intArrayOf(1, 2, 3, 4).asSequence().mapIndexed { ix, _ -> ix }.count()
}
@@ -0,0 +1,6 @@
package map
fun main(args: Array<String>) {
// Breakpoint!
val lst = listOf(1, 2, null, 3).asSequence().mapNotNull { if (it != null && it % 2 == 1) it else null }.toList()
}
@@ -0,0 +1,7 @@
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package map
fun main(args: Array<String>) {
// Breakpoint!
intArrayOf(1, 2, 3).asSequence().withIndex().forEach {}
}