@@ -61,9 +61,27 @@ public void testEncodeUrl() throws Exception {
6161
6262 @ Test
6363 public void testEscapeForHtml () throws Exception {
64- String input = "& < > \" " ;
65- String outputNoChange = "& < > "" ;
66- String outputChange = "& < > "" ;
64+ String input = "\t & < > \" " ;
65+ String outputNoChange = "\t & < > "" ;
66+ String outputChange = " & < > "" ;
67+ assertEquals (outputNoChange , StringUtils .escapeForHtml (input , false ));
68+ assertEquals (outputChange , StringUtils .escapeForHtml (input , true ));
69+
70+ input = "a\t b" ;
71+ outputNoChange = "a\t b" ;
72+ outputChange = "a b" ;
73+ assertEquals (outputNoChange , StringUtils .escapeForHtml (input , false ));
74+ assertEquals (outputChange , StringUtils .escapeForHtml (input , true ));
75+
76+ input = "\t a b\t " ;
77+ outputNoChange = "\t a b\t " ;
78+ outputChange = " a b " ;
79+ assertEquals (outputNoChange , StringUtils .escapeForHtml (input , false ));
80+ assertEquals (outputChange , StringUtils .escapeForHtml (input , true ));
81+
82+ input = "\t <> \t " ;
83+ outputNoChange = "\t <> \t " ;
84+ outputChange = " <> " ;
6785 assertEquals (outputNoChange , StringUtils .escapeForHtml (input , false ));
6886 assertEquals (outputChange , StringUtils .escapeForHtml (input , true ));
6987
0 commit comments