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.
18 lines
563 B
Kotlin
18 lines
563 B
Kotlin
import kotlin.test.*
|
|
import kotlin.comparisons.*
|
|
|
|
fun box() {
|
|
val nameToTeam = listOf("Alice" to "Marketing", "Bob" to "Sales", "Carol" to "Marketing")
|
|
val namesByTeam = nameToTeam.groupBy({ it.second }, { it.first })
|
|
assertEquals(
|
|
listOf(
|
|
"Marketing" to listOf("Alice", "Carol"),
|
|
"Sales" to listOf("Bob")
|
|
),
|
|
namesByTeam.toList())
|
|
|
|
|
|
val mutableNamesByTeam = nameToTeam.groupByTo(HashMap(), { it.second }, { it.first })
|
|
assertEquals(namesByTeam, mutableNamesByTeam)
|
|
}
|