From c739e01c6827f0849f5c3903bc640648bac2b70f Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Fri, 11 Jan 2008 20:26:02 +0000 Subject: [PATCH] add'l splitByCharacterType tests for single trailing characters git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@611290 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/commons/lang/StringUtils.java | 2 ++ src/test/org/apache/commons/lang/StringUtilsTest.java | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/commons/lang/StringUtils.java b/src/java/org/apache/commons/lang/StringUtils.java index bd72bb859..3a5d1ae04 100644 --- a/src/java/org/apache/commons/lang/StringUtils.java +++ b/src/java/org/apache/commons/lang/StringUtils.java @@ -2617,6 +2617,7 @@ public class StringUtils { * StringUtils.splitByCamelCase("ab de fg") = ["ab", " ", "de", " ", "fg"] * StringUtils.splitByCamelCase("ab de fg") = ["ab", " ", "de", " ", "fg"] * StringUtils.splitByCamelCase("ab:cd:ef") = ["ab", ":", "cd", ":", "ef"] + * StringUtils.splitByCamelCase("number5") = ["number", "5"] * StringUtils.splitByCamelCase("fooBar") = ["foo", "B", "ar"] * StringUtils.splitByCamelCase("foo200Bar") = ["foo", "200", "B", "ar"] * StringUtils.splitByCamelCase("ASFRules") = ["ASFR", "ules"] @@ -2644,6 +2645,7 @@ public class StringUtils { * StringUtils.splitByCamelCase("ab de fg") = ["ab", " ", "de", " ", "fg"] * StringUtils.splitByCamelCase("ab de fg") = ["ab", " ", "de", " ", "fg"] * StringUtils.splitByCamelCase("ab:cd:ef") = ["ab", ":", "cd", ":", "ef"] + * StringUtils.splitByCamelCase("number5") = ["number", "5"] * StringUtils.splitByCamelCase("fooBar") = ["foo", "Bar"] * StringUtils.splitByCamelCase("foo200Bar") = ["foo", "200", "Bar"] * StringUtils.splitByCamelCase("ASFRules") = ["ASF", "Rules"] diff --git a/src/test/org/apache/commons/lang/StringUtilsTest.java b/src/test/org/apache/commons/lang/StringUtilsTest.java index f87e60403..e6f0176a5 100644 --- a/src/test/org/apache/commons/lang/StringUtilsTest.java +++ b/src/test/org/apache/commons/lang/StringUtilsTest.java @@ -873,6 +873,12 @@ public class StringUtilsTest extends TestCase { assertTrue(ArrayUtils.isEquals(new String[] { "ab", ":", "cd", ":", "ef" }, StringUtils.splitByCharacterType("ab:cd:ef", camelCase))); + + assertTrue(ArrayUtils.isEquals(new String[] { "number", "5" }, + StringUtils.splitByCharacterType("number5"))); + + assertTrue(ArrayUtils.isEquals(new String[] { "number", "5" }, + StringUtils.splitByCharacterType("number5", camelCase))); assertTrue(ArrayUtils.isEquals(new String[] { "foo", "B", "ar" }, StringUtils.splitByCharacterType("fooBar"))); @@ -891,7 +897,6 @@ public class StringUtilsTest extends TestCase { assertTrue(ArrayUtils.isEquals(new String[] { "ASF", "Rules" }, StringUtils.splitByCharacterType("ASFRules", camelCase))); - } public void testDeprecatedDeleteSpace_String() {