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.
11 lines
487 B
Kotlin
11 lines
487 B
Kotlin
import kotlin.test.*
|
|
import kotlin.comparisons.*
|
|
|
|
val STRING_CASE_INSENSITIVE_ORDER: Comparator<String> = compareBy { it: String -> it.toUpperCase() }.thenBy { it.toLowerCase() }.thenBy { it }
|
|
fun box() {
|
|
expect(null, { listOf<Int>().minWith(naturalOrder()) })
|
|
expect(1, { listOf(1).minWith(naturalOrder()) })
|
|
expect("a", { listOf("a", "B").minWith(STRING_CASE_INSENSITIVE_ORDER) })
|
|
expect("a", { listOf("a", "B").asSequence().minWith(STRING_CASE_INSENSITIVE_ORDER) })
|
|
}
|