"
@@ -137,23 +138,33 @@ public class HtmlConverterTest extends TestCase {
public void testPreserveSpacesAtFirst() {
String message = "foo\n"
+ " bar\n"
- + " baz\n"
- + " \n"
- + " &\n"
- + " \r\n"
- + " <\n"
- + " >\n";
+ + " baz\n";
String result = HtmlConverter.textToHtml(message);
writeToFile(result);
assertEquals(""
+ "foo
"
+ " bar
"
+ " baz
"
+ + "
", result);
+ }
+
+ public void testPreserveSpacesAtFirstForSpecialCharacters() {
+ String message =
+ " \n"
+ + " &\n"
+ + " \r\n"
+ + " <\n"
+ + " > \n";
+ String result = HtmlConverter.textToHtml(message);
+ writeToFile(result);
+ assertEquals(""
+ "
"
+ " &
"
+ "
"
+ " <
"
- + " >
"
+ + ""
+ + "
"
+ + "
"
+ "
", result);
}
}