mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-12 04:55:14 +00:00
make test strings 7-bit clean (bug 18836)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137290 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3ac32dd142
commit
2e862e0c47
@ -66,7 +66,7 @@
|
|||||||
*
|
*
|
||||||
* @author of original StringUtilsTest.testEscape = ?
|
* @author of original StringUtilsTest.testEscape = ?
|
||||||
* @author <a href="mailto:alex@purpletech.com">Alexander Day Chaffee</a>
|
* @author <a href="mailto:alex@purpletech.com">Alexander Day Chaffee</a>
|
||||||
* @version $Id: StringEscapeUtilsTest.java,v 1.1 2003/03/31 03:53:52 alex Exp $
|
* @version $Id: StringEscapeUtilsTest.java,v 1.2 2003/04/09 17:30:29 alex Exp $
|
||||||
*/
|
*/
|
||||||
public class StringEscapeUtilsTest extends TestCase {
|
public class StringEscapeUtilsTest extends TestCase {
|
||||||
private final static String FOO = "foo";
|
private final static String FOO = "foo";
|
||||||
@ -153,7 +153,7 @@ public void testEscapeJavaScript() {
|
|||||||
{"final character only", "greater than >", "greater than >"},
|
{"final character only", "greater than >", "greater than >"},
|
||||||
{"first character only", "< less than", "< less than"},
|
{"first character only", "< less than", "< less than"},
|
||||||
{"apostrophe", "Huntington's chorea", "Huntington's chorea"},
|
{"apostrophe", "Huntington's chorea", "Huntington's chorea"},
|
||||||
{"languages", "English,Français,日本語 (nihongo)", "English,Français,\u65E5\u672C\u8A9E (nihongo)"},
|
{"languages", "English,Français,日本語 (nihongo)", "English,Fran\u00E7ais,\u65E5\u672C\u8A9E (nihongo)"},
|
||||||
};
|
};
|
||||||
|
|
||||||
public void testEscapeHtml() {
|
public void testEscapeHtml() {
|
||||||
@ -168,8 +168,10 @@ public void testHtmlunescape() {
|
|||||||
assertEquals(htmlEscapes[i][0], htmlEscapes[i][2], StringEscapeUtils.unescapeHtml(htmlEscapes[i][1]));
|
assertEquals(htmlEscapes[i][0], htmlEscapes[i][2], StringEscapeUtils.unescapeHtml(htmlEscapes[i][1]));
|
||||||
// todo: add test for (and implement) Writer-based version
|
// todo: add test for (and implement) Writer-based version
|
||||||
}
|
}
|
||||||
// should we unicode-escape the cedilla here, for 7-bit cleanliness?
|
// \u00E7 is a cedilla (ç)
|
||||||
assertEquals("funny chars pass through OK", "Français", StringEscapeUtils.unescapeHtml("Français"));
|
// note that the test string must be 7-bit-clean (unicode escaped) or else it will compile incorrectly
|
||||||
|
// on some locales
|
||||||
|
assertEquals("funny chars pass through OK", "Fran\u00E7ais", StringEscapeUtils.unescapeHtml("Fran\u00E7ais"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// SQL
|
// SQL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user