Update MarkdownUtilTest.java

This commit is contained in:
Jimmy-7664 2021-05-07 11:08:12 +08:00 committed by Niedermann IT-Dienstleistungen
parent 7a81d82592
commit 3924618164

View file

@ -244,42 +244,42 @@ public class MarkdownUtilTest extends TestCase {
// Special use-case: toggle from italic to bold and back
// TODO Toggle italic on bold text
// Toggle italic on bold text
builder = new SpannableStringBuilder("Lorem **ipsum** dolor sit amet.");
assertEquals(17, MarkdownUtil.togglePunctuation(builder, 8, 13, "*"));
assertEquals("Lorem ***ipsum*** dolor sit amet.", builder.toString());
// TODO Toggle bold on italic text
// Toggle bold on italic text
builder = new SpannableStringBuilder("Lorem *ipsum* dolor sit amet.");
assertEquals(17, MarkdownUtil.togglePunctuation(builder, 7, 12, "**"));
assertEquals("Lorem ***ipsum*** dolor sit amet.", builder.toString());
// TODO Toggle bold to italic
// Toggle bold to italic
builder = new SpannableStringBuilder("Lorem **ipsum** dolor sit amet.");
assertEquals(17, MarkdownUtil.togglePunctuation(builder, 0, 31, "*"));
assertEquals("Lorem ***ipsum*** dolor sit amet.", builder.toString());
// TODO Toggle multiple bold parts to italic
// Toggle multiple bold parts to italic
builder = new SpannableStringBuilder("Lorem **ipsum** dolor **sit** amet.");
assertEquals(33, MarkdownUtil.togglePunctuation(builder, 0, 34, "*"));
assertEquals("Lorem ***ipsum*** dolor ***sit*** amet.", builder.toString());
// TODO Toggle italic and bold to bold
// Toggle italic and bold to bold
builder = new SpannableStringBuilder("Lorem ***ipsum*** dolor sit amet.");
assertEquals(13, MarkdownUtil.togglePunctuation(builder, 0, 14, "*"));
assertEquals("Lorem **ipsum** dolor sit amet.", builder.toString());
// TODO Toggle italic and bold to italic
// Toggle italic and bold to italic
builder = new SpannableStringBuilder("Lorem ***ipsum*** dolor sit amet.");
assertEquals(12, MarkdownUtil.togglePunctuation(builder, 9, 14, "**"));
assertEquals("Lorem *ipsum* dolor sit amet.", builder.toString());
// TODO Toggle multiple italic and bold to bold
// Toggle multiple italic and bold to bold
builder = new SpannableStringBuilder("Lorem ***ipsum*** dolor ***sit*** amet.");
assertEquals(27, MarkdownUtil.togglePunctuation(builder, 0, 38, "*"));
assertEquals("Lorem **ipsum** dolor **sit** amet.", builder.toString());
// TODO Toggle multiple italic and bold to italic
// Toggle multiple italic and bold to italic
builder = new SpannableStringBuilder("Lorem ***ipsum*** dolor ***sit*** amet.");
assertEquals(24, MarkdownUtil.togglePunctuation(builder, 0, 38, "**"));
assertEquals("Lorem *ipsum* dolor *sit* amet.", builder.toString());