commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1304) Add a method in StringUtils to check for mixed case in string
Date Fri, 30 Dec 2016 03:16:58 GMT

    [ https://issues.apache.org/jira/browse/LANG-1304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15786750#comment-15786750
] 

ASF GitHub Bot commented on LANG-1304:
--------------------------------------

Github user bindul commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/223#discussion_r94199781
  
    --- 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 --
    
    Can you please add a test for a single character string? I think the implementation breaks
when there is only a single character in the String/CharSequence


> Add a method in StringUtils to check for mixed case in string
> -------------------------------------------------------------
>
>                 Key: LANG-1304
>                 URL: https://issues.apache.org/jira/browse/LANG-1304
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.*
>            Reporter: Arshad Basha
>            Priority: Minor
>             Fix For: 3.6
>
>
> It would be nice to have a method that check whether the string has mixed (lower and
upper) case.
> Examples:
> StringUtils.isMixedCase("passWORD"); //true
> StringUtils.isMixedCase("PASSWORD"); //false
> StringUtils.isMixedCase("password"); //false



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message