\r
@Test\r
public void testEscapeForHtml() throws Exception {\r
- String input = "& < > \"";\r
- String outputNoChange = "& < > "";\r
- String outputChange = "& < > "";\r
+ String input = "\t & < > \"";\r
+ String outputNoChange = "\t & < > "";\r
+ String outputChange = " & < > "";\r
+ assertEquals(outputNoChange, StringUtils.escapeForHtml(input, false));\r
+ assertEquals(outputChange, StringUtils.escapeForHtml(input, true));\r
+\r
+ input = "a\tb";\r
+ outputNoChange = "a\tb";\r
+ outputChange = "a b";\r
+ assertEquals(outputNoChange, StringUtils.escapeForHtml(input, false));\r
+ assertEquals(outputChange, StringUtils.escapeForHtml(input, true));\r
+\r
+ input = "\ta b\t";\r
+ outputNoChange = "\ta b\t";\r
+ outputChange = " a b ";\r
+ assertEquals(outputNoChange, StringUtils.escapeForHtml(input, false));\r
+ assertEquals(outputChange, StringUtils.escapeForHtml(input, true));\r
+\r
+ input = "\t <> \t";\r
+ outputNoChange = "\t <> \t";\r
+ outputChange = " <> ";\r
assertEquals(outputNoChange, StringUtils.escapeForHtml(input, false));\r
assertEquals(outputChange, StringUtils.escapeForHtml(input, true));\r
\r