From ae681cb7fe9034984cea8946e8e85e4617f76f8c Mon Sep 17 00:00:00 2001 From: Koji Arai Date: Thu, 9 May 2013 22:11:05 +0900 Subject: [PATCH] Added test for preserve spaces at first of line --- .../com/fsck/k9/helper/HtmlConverterTest.java | 41 +++++++++++++------ 1 file changed, 28 insertions(+), 13 deletions(-) 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); + } }