JS: create new common directory for all generated tests, migrate several tests there

This commit is contained in:
Alexey Andreev
2016-08-26 16:44:48 +03:00
parent 34a57f863b
commit 2bf0199959
321 changed files with 2123 additions and 2001 deletions
@@ -0,0 +1,24 @@
package foo
import java.util.*
fun <T> ArrayList<T>.findAll(predicate: (T) -> Boolean): ArrayList<T> {
val result = ArrayList<T>()
for (t in this) {
if (predicate(t)) result.add(t)
}
return result
}
fun box(): String {
val list: ArrayList<Int> = ArrayList<Int>()
list.add(2)
list.add(3)
list.add(5)
val m: ArrayList<Int> = list.findAll<Int>({ name: Int -> name < 4 })
return if (m.size == 2) "OK" else "fail"
}