You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/06/19 15:01:02 UTC

[GitHub] [commons-lang] shalk opened a new pull request, #913: remove some duplicate assertion in StringUtilsTest

shalk opened a new pull request, #913:
URL: https://github.com/apache/commons-lang/pull/913

   keep it clean


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] kinow commented on a diff in pull request #913: remove some duplicate assertion in StringUtilsTest

Posted by GitBox <gi...@apache.org>.
kinow commented on code in PR #913:
URL: https://github.com/apache/commons-lang/pull/913#discussion_r901153942


##########
src/test/java/org/apache/commons/lang3/StringUtilsTest.java:
##########
@@ -1623,13 +1622,9 @@ public void testReCapitalize() {
     public void testRemove_char() {
         // StringUtils.remove(null, *)       = null
         assertNull(StringUtils.remove(null, 'a'));
-        assertNull(StringUtils.remove(null, 'a'));
-        assertNull(StringUtils.remove(null, 'a'));
 
         // StringUtils.remove("", *)          = ""
         assertEquals("", StringUtils.remove("", 'a'));
-        assertEquals("", StringUtils.remove("", 'a'));
-        assertEquals("", StringUtils.remove("", 'a'));

Review Comment:
   This method, `testRemove_char`, appears to have been based off the `testRemove_String`. You are correct these three statements are duplicated and can be removed. But in `testRemove_String` there's one test case that must be added here as well:
   
   ```
   assertNull(StringUtils.remove(null, null));
   &
   assertEquals("", StringUtils.remove("", null));
   ```
   
   Can you add them, please, @shalk ?



##########
src/test/java/org/apache/commons/lang3/StringUtilsTest.java:
##########
@@ -2774,7 +2769,6 @@ public void testSplitPreserveAllTokens_StringChar() {
         assertEquals("b", res[1]);
         assertEquals("c", res[2]);
         assertEquals("", res[3]);
-        assertEquals("", res[3]);

Review Comment:
   I believe this was supposed to be `assertEquals("", res[4]);`. The other tests have a similar case, where they verify the indexes from `0` to the last index available (`4` in this case). Can you change it, please?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] shalk commented on a diff in pull request #913: remove some duplicate assertion in StringUtilsTest

Posted by GitBox <gi...@apache.org>.
shalk commented on code in PR #913:
URL: https://github.com/apache/commons-lang/pull/913#discussion_r901820830


##########
src/test/java/org/apache/commons/lang3/StringUtilsTest.java:
##########
@@ -1623,13 +1622,9 @@ public void testReCapitalize() {
     public void testRemove_char() {
         // StringUtils.remove(null, *)       = null
         assertNull(StringUtils.remove(null, 'a'));
-        assertNull(StringUtils.remove(null, 'a'));
-        assertNull(StringUtils.remove(null, 'a'));
 
         // StringUtils.remove("", *)          = ""
         assertEquals("", StringUtils.remove("", 'a'));
-        assertEquals("", StringUtils.remove("", 'a'));
-        assertEquals("", StringUtils.remove("", 'a'));

Review Comment:
   done



##########
src/test/java/org/apache/commons/lang3/StringUtilsTest.java:
##########
@@ -2774,7 +2769,6 @@ public void testSplitPreserveAllTokens_StringChar() {
         assertEquals("b", res[1]);
         assertEquals("c", res[2]);
         assertEquals("", res[3]);
-        assertEquals("", res[3]);

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] codecov-commenter commented on pull request #913: remove some duplicate assertion in StringUtilsTest

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #913:
URL: https://github.com/apache/commons-lang/pull/913#issuecomment-1159749915

   # [Codecov](https://codecov.io/gh/apache/commons-lang/pull/913?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#913](https://codecov.io/gh/apache/commons-lang/pull/913?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (af085e2) into [master](https://codecov.io/gh/apache/commons-lang/commit/2e71945163b08326a64b7264466069dd3a83b0de?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2e71945) will **decrease** coverage by `0.01%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #913      +/-   ##
   ============================================
   - Coverage     91.75%   91.73%   -0.02%     
   + Complexity     7439     7437       -2     
   ============================================
     Files           188      188              
     Lines         15944    15944              
     Branches       2994     2994              
   ============================================
   - Hits          14629    14626       -3     
   - Misses          724      725       +1     
   - Partials        591      593       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/commons-lang/pull/913?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...he/commons/lang3/concurrent/AtomicInitializer.java](https://codecov.io/gh/apache/commons-lang/pull/913/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvY29uY3VycmVudC9BdG9taWNJbml0aWFsaXplci5qYXZh) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
   | [...ache/commons/lang3/concurrent/LazyInitializer.java](https://codecov.io/gh/apache/commons-lang/pull/913/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvbGFuZzMvY29uY3VycmVudC9MYXp5SW5pdGlhbGl6ZXIuamF2YQ==) | `90.90% <0.00%> (-9.10%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/commons-lang/pull/913?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/commons-lang/pull/913?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [2e71945...af085e2](https://codecov.io/gh/apache/commons-lang/pull/913?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] kinow closed pull request #913: remove some duplicate assertion in StringUtilsTest

Posted by GitBox <gi...@apache.org>.
kinow closed pull request #913: remove some duplicate assertion in StringUtilsTest
URL: https://github.com/apache/commons-lang/pull/913


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [commons-lang] kinow commented on pull request #913: remove some duplicate assertion in StringUtilsTest

Posted by GitBox <gi...@apache.org>.
kinow commented on PR #913:
URL: https://github.com/apache/commons-lang/pull/913#issuecomment-1161177833

   Merged. Thanks @shalk !!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org