Add tests for filter operation
This commit is contained in:
committed by
Yan Zhulanow
parent
adb36d53fe
commit
e3d651ec09
+6
@@ -0,0 +1,6 @@
|
|||||||
|
package filter
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
// Breakpoint!
|
||||||
|
listOf("abc", "bde", "gh").filter { it.length < 3 }.count()
|
||||||
|
}
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
package filter
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
// Breakpoint!
|
||||||
|
listOf("23", "54", "4543").filter { it.length < 3 }
|
||||||
|
}
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
package filter
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
// Breakpoint!
|
||||||
|
listOf(Any(), Any(), Any()).filter { false }.count()
|
||||||
|
}
|
||||||
+1
-1
@@ -2,5 +2,5 @@ package filter
|
|||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
// Breakpoint!
|
// Breakpoint!
|
||||||
listOf(1, 2).filter { it % 2 == 0 }
|
listOf(1, 2, 3).filter { it == 2 }.count()
|
||||||
}
|
}
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
package filter
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
// Breakpoint!
|
||||||
|
byteArrayOf(1, 3, 50).filter { it == 50.toByte() }
|
||||||
|
}
|
||||||
+7
-3
@@ -4,7 +4,11 @@ package com.intellij.debugger.streams.kotlin.exec.collection
|
|||||||
* @author Vitaliy.Bibaev
|
* @author Vitaliy.Bibaev
|
||||||
*/
|
*/
|
||||||
class FilterOperationsTest : CollectionTestCase("filter") {
|
class FilterOperationsTest : CollectionTestCase("filter") {
|
||||||
fun testFilter() {
|
fun testFilterAsIntermediate() = doTestWithResult()
|
||||||
doTestWithResult()
|
fun testFilterAsTerminal() = doTestWithResult()
|
||||||
}
|
|
||||||
|
fun testFilterPrimitive() = doTestWithResult()
|
||||||
|
fun testFilterPrimitiveAsTermination() = doTestWithResult()
|
||||||
|
|
||||||
|
fun testFilterPassNothing() = doTestWithResult()
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user