IcoreE opened a new pull request, #1511:
URL: https://github.com/apache/commons-lang/pull/1511
In the unit test testCountMatches_char of StringUtilsSubstringTest, one of
the assertions is calling the wrong overload of countMatches.
```
@Test
void testCountMatches_char() {
assertEquals(0, StringUtils.countMatches(null, 'D'));
assertEquals(5, StringUtils.countMatches("one long someone sentence of
one", ' '));
assertEquals(6, StringUtils.countMatches("one long someone sentence of
one", 'o'));
assertEquals(4, StringUtils.countMatches("oooooooooooo", "ooo")); // <--
incorrect overload
}
```
The last assertion invokes:
`StringUtils.countMatches(CharSequence str, CharSequence sub)
`
even though the test method is intended to verify the char-based overload:
`StringUtils.countMatches(CharSequence str, char ch)`
This assertion should either:
1. Be moved to a test that validates substring-based countMatches, or
2. Be rewritten to use the char version if it is intended to stay within
this test.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]