diff --git a/tests/src/com/fsck/k9/helper/HtmlConverterTest.java b/tests/src/com/fsck/k9/helper/HtmlConverterTest.java index f18844480..da9ccab32 100644 --- a/tests/src/com/fsck/k9/helper/HtmlConverterTest.java +++ b/tests/src/com/fsck/k9/helper/HtmlConverterTest.java @@ -30,18 +30,18 @@ public class HtmlConverterTest extends TestCase { + "
" + "Bob Barker <bob@aol.com> wrote:
" + "
" - + "a canal
" + + " a canal
" + "
" - + "Dorothy Jo Gideon <dorothy@aol.com> espoused:
" + + " Dorothy Jo Gideon <dorothy@aol.com> espoused:
" + "
" + "A man, a plan...
" + "
" - + "Too easy!
" + + " Too easy!" + "
" + "Nice job :)
" + "
" + "
" - + "Guess!" + + " Guess!" + "
" + "
" + "", result); @@ -63,11 +63,11 @@ public class HtmlConverterTest extends TestCase { + "
" + "Bob Barker <bob@aol.com> wrote:
" + "
" - + "A wise man once said...
" + + " A wise man once said...
" + "
" - + "LOL F1RST!!!!!
" + + " LOL F1RST!!!!!
" + "
" - + ":)" + + " :)" + "
", result); } @@ -95,17 +95,17 @@ public class HtmlConverterTest extends TestCase { assertEquals("
"
                 + "zero
" + "
" - + "one
" + + " one
" + "
" - + "two
" + + " two
" + "
" - + "three
" + + " three
" + "
" - + "four
" + + " four
" + "
" - + "five
" + + " five
" + "
" - + "six" + + " six" + "
" + "
" + "
" @@ -133,4 +133,19 @@ public class HtmlConverterTest extends TestCase { e.printStackTrace(); } } + + public void testPreserveSpacesAtFirst() { + String message = "foo\n" + + " bar\n" + + " baz\n" + + "\n"; + String result = HtmlConverter.textToHtml(message); + writeToFile(result); + assertEquals("
"
+                + "foo
" + + " bar
" + + " baz
" + + "
" + + "
", result); + } }