Adding a unit test for LANG-729

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1148172 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2011-07-19 05:17:03 +00:00
parent 5997452fe7
commit de3285f462
1 changed files with 12 additions and 0 deletions

View File

@ -32,6 +32,7 @@ import org.junit.Test;
import org.apache.commons.lang3.text.translate.CharSequenceTranslator; import org.apache.commons.lang3.text.translate.CharSequenceTranslator;
import org.apache.commons.lang3.text.translate.NumericEntityEscaper; import org.apache.commons.lang3.text.translate.NumericEntityEscaper;
import org.apache.commons.lang3.text.translate.NumericEntityUnescaper;
/** /**
* Unit tests for {@link StringEscapeUtils}. * Unit tests for {@link StringEscapeUtils}.
@ -344,6 +345,17 @@ public class StringEscapeUtilsTest {
escapeXml.translate("\uD84C\uDFB4")); escapeXml.translate("\uD84C\uDFB4"));
} }
/**
* Reverse of the above.
*
* @see <a href="https://issues.apache.org/jira/browse/LANG-729">LANG-729</a>
*/
@Test
public void testUnescapeXmlSupplementaryCharacters() {
assertEquals("Supplementary character must be represented using a single escape", "\uD84C\uDFB4",
StringEscapeUtils.unescapeXml("&#144308;") );
}
// Tests issue #38569 // Tests issue #38569
// http://issues.apache.org/bugzilla/show_bug.cgi?id=38569 // http://issues.apache.org/bugzilla/show_bug.cgi?id=38569
@Test @Test