Locale-agnostic case conversions by default #KT-43023
This commit is contained in:
@@ -489,7 +489,7 @@ class CollectionTest {
|
||||
assertEquals(mapOf("Alice" to 5, "Bob" to 3, "Carol" to 5), itemsWithTheirLength)
|
||||
|
||||
val updatedLength =
|
||||
items.drop(1).associateWithTo(itemsWithTheirLength.toMutableMap()) { name -> name.toLowerCase().count { it in "aeuio" }}
|
||||
items.drop(1).associateWithTo(itemsWithTheirLength.toMutableMap()) { name -> name.lowercase().count { it in "aeuio" }}
|
||||
|
||||
assertEquals(mapOf("Alice" to 5, "Bob" to 1, "Carol" to 2), updatedLength)
|
||||
}
|
||||
@@ -1099,7 +1099,7 @@ class CollectionTest {
|
||||
}
|
||||
|
||||
@Test fun sortedWith() {
|
||||
val comparator = compareBy<String> { it.toUpperCase().reversed() }
|
||||
val comparator = compareBy<String> { it.uppercase().reversed() }
|
||||
val data = listOf("cat", "dad", "BAD")
|
||||
|
||||
expect(listOf("BAD", "dad", "cat")) { data.sortedWith(comparator) }
|
||||
|
||||
Reference in New Issue
Block a user