Skip to content

Commit c479fc9

Browse files
authored
Run invalidUnicode for js target, introduce additional test for Paragraph (JetBrains#981)
1 parent dc80eb4 commit c479fc9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

skiko/src/commonTest/kotlin/org/jetbrains/skia/ParagraphTest.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ class ParagraphTest {
8787
}
8888

8989
@Test
90-
@SkipJsTarget // FIXME Emscripten's stringToUTF8 function does not correctly handle invalid unicode symbols.
9190
fun invalidUnicode() = runTest {
9291
val invalidUnicodeText = "🦊qwerty".substring(1)
9392

@@ -98,6 +97,17 @@ class ParagraphTest {
9897
assertEquals(1, paragraph.lineNumber)
9998
}
10099

100+
@Test
101+
fun emptyString() = runTest {
102+
// https://github.com/JetBrains/skiko/issues/963
103+
val paragraph = ParagraphBuilder(style, fontCollection())
104+
.pushStyle(TextStyle())
105+
.addText("")
106+
.popStyle()
107+
.build()
108+
assertEquals("", paragraph.getText())
109+
}
110+
101111
@Test
102112
fun canCreate() = runTest {
103113
val text = "Hello,\n Пользователь1!"

0 commit comments

Comments
 (0)