From c479fc9b52497c2b33ff4b20612ad801178086e1 Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Fri, 16 Aug 2024 17:25:14 +0200 Subject: [PATCH] Run invalidUnicode for js target, introduce additional test for Paragraph (#981) --- .../kotlin/org/jetbrains/skia/ParagraphTest.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/skiko/src/commonTest/kotlin/org/jetbrains/skia/ParagraphTest.kt b/skiko/src/commonTest/kotlin/org/jetbrains/skia/ParagraphTest.kt index 22560206a..40ab5ae68 100644 --- a/skiko/src/commonTest/kotlin/org/jetbrains/skia/ParagraphTest.kt +++ b/skiko/src/commonTest/kotlin/org/jetbrains/skia/ParagraphTest.kt @@ -87,7 +87,6 @@ class ParagraphTest { } @Test - @SkipJsTarget // FIXME Emscripten's stringToUTF8 function does not correctly handle invalid unicode symbols. fun invalidUnicode() = runTest { val invalidUnicodeText = "🦊qwerty".substring(1) @@ -98,6 +97,17 @@ class ParagraphTest { assertEquals(1, paragraph.lineNumber) } + @Test + fun emptyString() = runTest { + // https://github.com/JetBrains/skiko/issues/963 + val paragraph = ParagraphBuilder(style, fontCollection()) + .pushStyle(TextStyle()) + .addText("") + .popStyle() + .build() + assertEquals("", paragraph.getText()) + } + @Test fun canCreate() = runTest { val text = "Hello,\n Пользователь1!"