You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by mureinik <gi...@git.apache.org> on 2017/09/30 12:37:37 UTC

[GitHub] commons-lang pull request #293: Char utils test

GitHub user mureinik opened a pull request:

    https://github.com/apache/commons-lang/pull/293

    Char utils test

    Several enhancements to `CharUtilsTest` to make the test more robust and cover more functionality.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mureinik/commons-lang CharUtilsTest

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/293.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #293
    
----
commit c00920fe55dc61504bc0de2a8df004fc7264f5bf
Author: Allon Mureinik <am...@redhat.com>
Date:   2017-09-30T12:25:34Z

    Clean up if in CharUtilsTest#testIsAscii_char
    
    The if statement calls assertTrue on the if branch and assertFalse on
    the else branch on the same expression. This can easily be simplified
    to assertEquals with a boolean expression to make the code clean and
    easier to read.

commit 9512d67084b340c7493ff89f2f2cd2e4eee33241
Author: Allon Mureinik <am...@redhat.com>
Date:   2017-09-30T12:27:42Z

    CharUtilsTest#testIsAscii_char loop
    
    The loop currently loops only up to 128, thus testing just positive
    return values of CharUtils#isAscii(char). This patch increase the loop
    to go over all the possible values of an unsigned byte, thus testing
    also negative return values.

commit b763decb69826b0fd4387e53dfd9c4ca5ab91467
Author: Allon Mureinik <am...@redhat.com>
Date:   2017-09-30T12:32:54Z

    Improve tests for CharUtils illegal usages
    
    CharUtilsTest has several instances of the following pattern:
    
        try {
            CharUtils.someMethod("illegal input");
        } catch (final IllegalArgumentException ex) {}
    
    This pattern is not very useful for testing, as the test would pass
    whether an IllegalArgumentException is thrown or not. This patch
    enhances the test by explicitly failing it if the exception is not
    thrown:
    
        try {
            CharUtils.someMethod("illegal input");
            fail("An IllegalArgumentException should have been thrown");
        } catch (final IllegalArgumentException ex) {}

----


---

[GitHub] commons-lang pull request #293: Char utils test

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/commons-lang/pull/293


---

[GitHub] commons-lang issue #293: Char utils test

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/commons-lang/pull/293
  
    
    [![Coverage Status](https://coveralls.io/builds/13509576/badge)](https://coveralls.io/builds/13509576)
    
    Coverage remained the same at 95.201% when pulling **b763decb69826b0fd4387e53dfd9c4ca5ab91467 on mureinik:CharUtilsTest** into **7076b7408f06bc8a277f58e7bb6c2ec3372d5d6f on apache:master**.



---

[GitHub] commons-lang issue #293: Char utils test

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:

    https://github.com/apache/commons-lang/pull/293
  
    Thanks! :+1: 


---