From de3285f462e8ddfbf9ba663dd5b6d8fd4c2b992c Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Tue, 19 Jul 2011 05:17:03 +0000 Subject: [PATCH] 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 --- .../apache/commons/lang3/StringEscapeUtilsTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java b/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java index bdb091694..dcdcbed6b 100644 --- a/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java @@ -32,6 +32,7 @@ import org.junit.Test; import org.apache.commons.lang3.text.translate.CharSequenceTranslator; import org.apache.commons.lang3.text.translate.NumericEntityEscaper; +import org.apache.commons.lang3.text.translate.NumericEntityUnescaper; /** * Unit tests for {@link StringEscapeUtils}. @@ -344,6 +345,17 @@ public class StringEscapeUtilsTest { escapeXml.translate("\uD84C\uDFB4")); } + /** + * Reverse of the above. + * + * @see LANG-729 + */ + @Test + public void testUnescapeXmlSupplementaryCharacters() { + assertEquals("Supplementary character must be represented using a single escape", "\uD84C\uDFB4", + StringEscapeUtils.unescapeXml("𣎴") ); + } + // Tests issue #38569 // http://issues.apache.org/bugzilla/show_bug.cgi?id=38569 @Test