Fixing javadoc example and adding a unit test to prove the example; as reported in #LANG-278

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@442618 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2006-09-12 15:29:31 +00:00
parent 66704164a0
commit ba57d261f1
2 changed files with 2 additions and 1 deletions

View File

@ -2795,7 +2795,7 @@ public class StringUtils {
* StringUtils.removeEnd(null, *) = null
* StringUtils.removeEnd("", *) = ""
* StringUtils.removeEnd(*, null) = *
* StringUtils.removeEnd("www.domain.com", ".com.") = "www,domain"
* StringUtils.removeEnd("www.domain.com", ".com.") = "www.domain.com."
* StringUtils.removeEnd("www.domain.com", ".com") = "www.domain"
* StringUtils.removeEnd("www.domain.com", "domain") = "www.domain.com"
* StringUtils.removeEnd("abc", "") = "abc"

View File

@ -1482,6 +1482,7 @@ public class StringUtilsTest extends TestCase {
assertEquals(StringUtils.removeEnd("", "a"), "");
// All others:
assertEquals(StringUtils.removeEnd("www.domain.com.", ".com"), "www.domain.com.");
assertEquals(StringUtils.removeEnd("www.domain.com", ".com"), "www.domain");
assertEquals(StringUtils.removeEnd("www.domain", ".com"), "www.domain");
assertEquals(StringUtils.removeEnd("domain.com", ""), "domain.com");