Skip to content

Commit

Permalink
add test for breaking up underscore separated words
Browse files Browse the repository at this point in the history
  • Loading branch information
seelchen committed Mar 27, 2024
1 parent 49d3bbb commit 8fc8f96
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,22 @@ class FormattingUtilsTest {

assertEquals(expectedHtml.trim(), html.trim())
}

@Test
fun `should build breakable text for underscore separated notation`(){
val testedText = "THIS_IS_UNDERSCORE_SEPARATED"
val expectedHtml = """
<html>
<body><span>THIS_</span><wbr></wbr><span>IS_</span><wbr></wbr><span>UNDERSCORE_</span><wbr></wbr><span>SEPARATED</span></body>
</html>
""".trimIndent()

val html = createHTML(prettyPrint = true).html {
body {
buildBreakableText(testedText)
}
}

assertEquals(expectedHtml.trim(), html.trim())
}
}

0 comments on commit 8fc8f96

Please sign in to comment.