Add support for CASE_INSENSITIVE_ORDER in JS and common

#KT-18067
This commit is contained in:
Ilya Gorbunov
2018-08-12 04:08:05 +03:00
parent 6866f5d19a
commit ed53983e1e
5 changed files with 25 additions and 7 deletions
+6
View File
@@ -804,6 +804,12 @@ class StringTest {
}
@Test fun orderIgnoringCase() {
val list = listOf("Beast", "Ast", "asterisk", "[]")
assertEquals(listOf("Ast", "Beast", "[]", "asterisk"), list.sorted())
assertEquals(listOf("[]", "Ast", "asterisk", "Beast"), list.sortedWith(String.CASE_INSENSITIVE_ORDER))
}
@Test fun replace() {
val input = "abbAb"
assertEquals("abb${'$'}b", input.replace('A', '$'))