85827b4880
This patch copies Kotlin/JVM stdlib tests (libraries/stdlib/test) excepting ones with explicit java dependencies. It also transforms the tests to use them as box-tests.
15 lines
438 B
Kotlin
15 lines
438 B
Kotlin
import kotlin.test.*
|
|
|
|
|
|
fun box() {
|
|
val elements = listOf("foo", "bar", "flea", "zoo", "biscuit")
|
|
val counts = elements.groupingBy { it.first() }.eachCount()
|
|
|
|
assertEquals(mapOf('f' to 2, 'b' to 2, 'z' to 1), counts)
|
|
|
|
val elements2 = arrayOf("zebra", "baz", "cab")
|
|
val counts2 = elements2.groupingBy { it.last() }.eachCountTo(HashMap(counts))
|
|
|
|
assertEquals(mapOf('f' to 2, 'b' to 3, 'a' to 1, 'z' to 2), counts2)
|
|
}
|