commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andyklimczak <...@git.apache.org>
Subject [GitHub] commons-lang pull request #223: [LANG-1304] StringUtils method to check for ...
Date Fri, 30 Dec 2016 04:05:20 GMT
Github user andyklimczak commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/223#discussion_r94201194
  
    --- Diff: src/test/java/org/apache/commons/lang3/StringUtilsTest.java ---
    @@ -2563,6 +2563,24 @@ public void testIsAllUpperCase() {
             assertFalse(StringUtils.isAllUpperCase("A/C"));
         }
     
    +    /**
    +     * Test for {@link StringUtils#isMixedCase(CharSequence)}.
    +     */
    +    @Test
    +    public void testIsMixedCase() {
    +        assertFalse(StringUtils.isMixedCase(null));
    +        assertFalse(StringUtils.isMixedCase(StringUtils.EMPTY));
    +        assertFalse(StringUtils.isMixedCase(" "));
    +        assertTrue(StringUtils.isMixedCase("aBc"));
    +        assertFalse(StringUtils.isMixedCase("abc"));
    +        assertFalse(StringUtils.isMixedCase("ABC"));
    +        assertFalse(StringUtils.isMixedCase("aBc "));
    +        assertFalse(StringUtils.isMixedCase("A c"));
    +        assertFalse(StringUtils.isMixedCase("aBc\n"));
    +        assertFalse(StringUtils.isMixedCase("A1c"));
    +        assertFalse(StringUtils.isMixedCase("a/C"));
    --- End diff --
    
    Done, and I added a quick return case to skip going into the loop unnecessarily because
a char sequence of length 1 cannot have both an upper and lowercase. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message