LANG-1059 Capitalize javadoc is incorrect
Add test to show that first character is upcased, not the first (alphabetic) letter that is found
This commit is contained in:
parent
5f479e70cd
commit
78e2f4c122
|
@ -5749,6 +5749,7 @@ public class StringUtils {
|
||||||
* StringUtils.capitalize("") = ""
|
* StringUtils.capitalize("") = ""
|
||||||
* StringUtils.capitalize("cat") = "Cat"
|
* StringUtils.capitalize("cat") = "Cat"
|
||||||
* StringUtils.capitalize("cAt") = "CAt"
|
* StringUtils.capitalize("cAt") = "CAt"
|
||||||
|
* StringUtils.capitalize("'cat'") = "'cat'"
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param str the String to capitalize, may be null
|
* @param str the String to capitalize, may be null
|
||||||
|
|
|
@ -249,6 +249,13 @@ public class StringUtilsTest {
|
||||||
FOO_CAP, StringUtils.capitalize(FOO_CAP));
|
FOO_CAP, StringUtils.capitalize(FOO_CAP));
|
||||||
assertEquals("capitalize(string) failed",
|
assertEquals("capitalize(string) failed",
|
||||||
FOO_CAP, StringUtils.capitalize(FOO_UNCAP));
|
FOO_CAP, StringUtils.capitalize(FOO_UNCAP));
|
||||||
|
|
||||||
|
// Javadoc examples
|
||||||
|
assertNull(StringUtils.capitalize(null));
|
||||||
|
assertEquals("", StringUtils.capitalize(""));
|
||||||
|
assertEquals("Cat", StringUtils.capitalize("cat"));
|
||||||
|
assertEquals("CAt", StringUtils.capitalize("cAt"));
|
||||||
|
assertEquals("'cat'", StringUtils.capitalize("'cat'"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue