commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1630619 - in /commons/proper/lang/trunk/src: main/java/org/apache/commons/lang3/StringUtils.java test/java/org/apache/commons/lang3/StringUtilsTest.java
Date Thu, 09 Oct 2014 23:19:33 GMT
Author: sebb
Date: Thu Oct  9 23:19:32 2014
New Revision: 1630619

URL: http://svn.apache.org/r1630619
Log:
LANG-1043 - isAllUpperCase should only check Alpha characters
Document and test additional cases

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=1630619&r1=1630618&r2=1630619&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java Thu
Oct  9 23:19:32 2014
@@ -6151,7 +6151,10 @@ public class StringUtils {
      * StringUtils.isAllLowerCase("")     = false
      * StringUtils.isAllLowerCase("  ")   = false
      * StringUtils.isAllLowerCase("abc")  = true
-     * StringUtils.isAllLowerCase("abC") = false
+     * StringUtils.isAllLowerCase("abC")  = false
+     * StringUtils.isAllLowerCase("ab c") = false
+     * StringUtils.isAllLowerCase("ab1c") = false
+     * StringUtils.isAllLowerCase("ab/c") = false
      * </pre>
      *
      * @param cs  the CharSequence to check, may be null
@@ -6183,7 +6186,10 @@ public class StringUtils {
      * StringUtils.isAllUpperCase("")     = false
      * StringUtils.isAllUpperCase("  ")   = false
      * StringUtils.isAllUpperCase("ABC")  = true
-     * StringUtils.isAllUpperCase("aBC") = false
+     * StringUtils.isAllUpperCase("aBC")  = false
+     * StringUtils.isAllUpperCase("A C")  = false
+     * StringUtils.isAllUpperCase("A1C")  = false
+     * StringUtils.isAllUpperCase("A/C")  = false
      * </pre>
      *
      * @param cs the CharSequence to check, may be null

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java?rev=1630619&r1=1630618&r2=1630619&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
Thu Oct  9 23:19:32 2014
@@ -2066,9 +2066,14 @@ public class StringUtilsTest {
     public void testIsAllLowerCase() {
         assertFalse(StringUtils.isAllLowerCase(null));
         assertFalse(StringUtils.isAllLowerCase(StringUtils.EMPTY));
+        assertFalse(StringUtils.isAllLowerCase("  "));
         assertTrue(StringUtils.isAllLowerCase("abc"));
         assertFalse(StringUtils.isAllLowerCase("abc "));
+        assertFalse(StringUtils.isAllLowerCase("abc\n"));
         assertFalse(StringUtils.isAllLowerCase("abC"));
+        assertFalse(StringUtils.isAllLowerCase("ab c"));
+        assertFalse(StringUtils.isAllLowerCase("ab1c"));
+        assertFalse(StringUtils.isAllLowerCase("ab/c"));
     }
 
     /**
@@ -2078,9 +2083,14 @@ public class StringUtilsTest {
     public void testIsAllUpperCase() {
         assertFalse(StringUtils.isAllUpperCase(null));
         assertFalse(StringUtils.isAllUpperCase(StringUtils.EMPTY));
+        assertFalse(StringUtils.isAllUpperCase("  "));
         assertTrue(StringUtils.isAllUpperCase("ABC"));
         assertFalse(StringUtils.isAllUpperCase("ABC "));
+        assertFalse(StringUtils.isAllUpperCase("ABC\n"));
         assertFalse(StringUtils.isAllUpperCase("aBC"));
+        assertFalse(StringUtils.isAllUpperCase("A C"));
+        assertFalse(StringUtils.isAllUpperCase("A1C"));
+        assertFalse(StringUtils.isAllUpperCase("A/C"));
     }
 
     @Test



Mime
View raw message