This commit is contained in:
Looly
2021-06-29 23:08:25 +08:00
parent 8caa7f890e
commit 3685f17b3a
3 changed files with 16 additions and 2 deletions

View File

@@ -40,8 +40,16 @@ public class EscapeUtilTest {
@Test
public void escapeSingleQuotesTest(){
// 单引号不做转义
String str = "'some text with single quotes'";
final String s = EscapeUtil.escapeHtml4(str);
Assert.assertEquals("'some text with single quotes'", s);
Assert.assertEquals("'some text with single quotes'", s);
}
@Test
public void unescapeSingleQuotesTest(){
String str = "'some text with single quotes'";
final String s = EscapeUtil.unescapeHtml4(str);
Assert.assertEquals("'some text with single quotes'", s);
}
}