Fixes UTF-32 Reactions

This commit is contained in:
Vitor Pamplona
2023-06-23 09:21:34 -04:00
parent a536388123
commit 33454cc2f8
5 changed files with 66 additions and 3 deletions
@@ -0,0 +1,37 @@
package com.vitorpamplona.amethyst
import com.vitorpamplona.amethyst.service.firstFullChar
import org.junit.Assert
import org.junit.Test
class CharsetTest {
@Test
fun testASCIIChar() {
Assert.assertEquals("H", "Hi".firstFullChar())
}
@Test
fun testUTF16Char() {
Assert.assertEquals("\uD83C\uDF48", "\uD83C\uDF48Hi".firstFullChar())
}
@Test
fun testUTF32Char() {
Assert.assertEquals("\uD83E\uDDD1\uD83C\uDFFE", "\uD83E\uDDD1\uD83C\uDFFEHi".firstFullChar())
}
@Test
fun testAsciiWithUTF32Char() {
Assert.assertEquals("H", "Hi\uD83E\uDDD1\uD83C\uDFFEHi".firstFullChar())
}
@Test
fun testBlank() {
Assert.assertEquals("", "".firstFullChar())
}
@Test
fun testSpecialChars() {
Assert.assertEquals("=", "=x".firstFullChar())
}
}