mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 22:12:05 +01:00
Added more cases to #testEscapeForXML.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2485 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
0f8bb65755
commit
9caf660bc0
1 changed files with 18 additions and 6 deletions
|
@ -65,22 +65,34 @@ public class StringUtilsTest extends TestCase {
|
||||||
assertNull(StringUtils.escapeForXML(null));
|
assertNull(StringUtils.escapeForXML(null));
|
||||||
|
|
||||||
input = "<b>";
|
input = "<b>";
|
||||||
assertEquals(StringUtils.escapeForXML(input), "<b>");
|
assertEquals("<b>", StringUtils.escapeForXML(input));
|
||||||
|
|
||||||
input = "\"";
|
input = "\"";
|
||||||
assertEquals(StringUtils.escapeForXML(input), """);
|
assertEquals(""", StringUtils.escapeForXML(input));
|
||||||
|
|
||||||
input = "&";
|
input = "&";
|
||||||
assertEquals(StringUtils.escapeForXML(input), "&");
|
assertEquals("&", StringUtils.escapeForXML(input));
|
||||||
|
|
||||||
input = "<b>\n\t\r</b>";
|
input = "<b>\n\t\r</b>";
|
||||||
assertEquals(StringUtils.escapeForXML(input), "<b>\n\t\r</b>");
|
assertEquals("<b>\n\t\r</b>", StringUtils.escapeForXML(input));
|
||||||
|
|
||||||
input = " & ";
|
input = " & ";
|
||||||
assertEquals(StringUtils.escapeForXML(input), " & ");
|
assertEquals(" & ", StringUtils.escapeForXML(input));
|
||||||
|
|
||||||
input = " \" ";
|
input = " \" ";
|
||||||
assertEquals(StringUtils.escapeForXML(input), " " ");
|
assertEquals(" " ", StringUtils.escapeForXML(input));
|
||||||
|
|
||||||
|
input = "> of me <";
|
||||||
|
assertEquals("> of me <", StringUtils.escapeForXML(input));
|
||||||
|
|
||||||
|
input = "> of me & you<";
|
||||||
|
assertEquals("> of me & you<", StringUtils.escapeForXML(input));
|
||||||
|
|
||||||
|
input = "& <";
|
||||||
|
assertEquals("& <", StringUtils.escapeForXML(input));
|
||||||
|
|
||||||
|
input = "&";
|
||||||
|
assertEquals("&", StringUtils.escapeForXML(input));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testHash() {
|
public void testHash() {
|
||||||
|
|
Loading…
Reference in a new issue