mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-11 04:56:39 +01:00
Fixes some of the testing cases
This commit is contained in:
@@ -4036,7 +4036,7 @@ class RichTextParserTest {
|
|||||||
@Test
|
@Test
|
||||||
fun testShortTextToParse() {
|
fun testShortTextToParse() {
|
||||||
val state =
|
val state =
|
||||||
com.vitorpamplona.amethyst.commons.RichTextParser()
|
RichTextParser()
|
||||||
.parseText("Hi, how are you doing? ", EmptyTagList)
|
.parseText("Hi, how are you doing? ", EmptyTagList)
|
||||||
org.junit.Assert.assertTrue(state.urlSet.isEmpty())
|
org.junit.Assert.assertTrue(state.urlSet.isEmpty())
|
||||||
org.junit.Assert.assertTrue(state.imagesForPager.isEmpty())
|
org.junit.Assert.assertTrue(state.imagesForPager.isEmpty())
|
||||||
@@ -4051,8 +4051,7 @@ class RichTextParserTest {
|
|||||||
@Test
|
@Test
|
||||||
fun testShortNewLinesTextToParse() {
|
fun testShortNewLinesTextToParse() {
|
||||||
val state =
|
val state =
|
||||||
com.vitorpamplona.amethyst.commons.RichTextParser()
|
RichTextParser().parseText("\nHi, \nhow\n\n\n are you doing? \n", EmptyTagList)
|
||||||
.parseText("\nHi, \nhow\n\n\n are you doing? \n", EmptyTagList)
|
|
||||||
org.junit.Assert.assertTrue(state.urlSet.isEmpty())
|
org.junit.Assert.assertTrue(state.urlSet.isEmpty())
|
||||||
org.junit.Assert.assertTrue(state.imagesForPager.isEmpty())
|
org.junit.Assert.assertTrue(state.imagesForPager.isEmpty())
|
||||||
org.junit.Assert.assertTrue(state.imageList.isEmpty())
|
org.junit.Assert.assertTrue(state.imageList.isEmpty())
|
||||||
@@ -4076,7 +4075,7 @@ class RichTextParserTest {
|
|||||||
.trimIndent()
|
.trimIndent()
|
||||||
|
|
||||||
val state =
|
val state =
|
||||||
com.vitorpamplona.amethyst.commons.RichTextParser()
|
RichTextParser()
|
||||||
.parseText(text, EmptyTagList)
|
.parseText(text, EmptyTagList)
|
||||||
org.junit.Assert.assertEquals(
|
org.junit.Assert.assertEquals(
|
||||||
"https://lnshort.it/live-stream-embeds/",
|
"https://lnshort.it/live-stream-embeds/",
|
||||||
@@ -4153,7 +4152,7 @@ class RichTextParserTest {
|
|||||||
"That’s it ! That’s the #note https://cdn.nostr.build/i/1dc0726b6cb0f94a92bd66765ffb90f6c67e90c17bb957fc3d5d4782cbd73de7.jpg "
|
"That’s it ! That’s the #note https://cdn.nostr.build/i/1dc0726b6cb0f94a92bd66765ffb90f6c67e90c17bb957fc3d5d4782cbd73de7.jpg "
|
||||||
|
|
||||||
val state =
|
val state =
|
||||||
com.vitorpamplona.amethyst.commons.RichTextParser()
|
RichTextParser()
|
||||||
.parseText(text, EmptyTagList)
|
.parseText(text, EmptyTagList)
|
||||||
|
|
||||||
printStateForDebug(state)
|
printStateForDebug(state)
|
||||||
@@ -4186,7 +4185,7 @@ class RichTextParserTest {
|
|||||||
"That’s it! https://cdn.nostr.build/i/1dc0726b6cb0f94a92bd66765ffb90f6c67e90c17bb957fc3d5d4782cbd73de7.jpg That’s the #note"
|
"That’s it! https://cdn.nostr.build/i/1dc0726b6cb0f94a92bd66765ffb90f6c67e90c17bb957fc3d5d4782cbd73de7.jpg That’s the #note"
|
||||||
|
|
||||||
val state =
|
val state =
|
||||||
com.vitorpamplona.amethyst.commons.RichTextParser()
|
RichTextParser()
|
||||||
.parseText(text, EmptyTagList)
|
.parseText(text, EmptyTagList)
|
||||||
|
|
||||||
printStateForDebug(state)
|
printStateForDebug(state)
|
||||||
@@ -4217,7 +4216,7 @@ class RichTextParserTest {
|
|||||||
val text = "That’s it! http://vitorpamplona.com/. That’s the note"
|
val text = "That’s it! http://vitorpamplona.com/. That’s the note"
|
||||||
|
|
||||||
val state =
|
val state =
|
||||||
com.vitorpamplona.amethyst.commons.RichTextParser()
|
RichTextParser()
|
||||||
.parseText(text, EmptyTagList)
|
.parseText(text, EmptyTagList)
|
||||||
|
|
||||||
printStateForDebug(state)
|
printStateForDebug(state)
|
||||||
@@ -4281,7 +4280,7 @@ class RichTextParserTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun printStateForDebug(state: com.vitorpamplona.amethyst.commons.RichTextViewerState) {
|
private fun printStateForDebug(state: RichTextViewerState) {
|
||||||
state.paragraphs.forEach { paragraph ->
|
state.paragraphs.forEach { paragraph ->
|
||||||
paragraph.words.forEach { seg ->
|
paragraph.words.forEach { seg ->
|
||||||
println(
|
println(
|
||||||
|
|||||||
Reference in New Issue
Block a user