Skip to content

Commit 2924a7b

Browse files
committed
Add test
1 parent 33a4da4 commit 2924a7b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@ void testIndexOfAny_StringCharArray() {
398398
assertEquals(0, StringUtils.indexOfAny("zzabyycdxx", 'z', 'a'));
399399
assertEquals(3, StringUtils.indexOfAny("zzabyycdxx", 'b', 'y'));
400400
assertEquals(-1, StringUtils.indexOfAny("ab", 'z'));
401+
// if more than one search char is present, the order of the search chars matters:
402+
assertEquals(0, StringUtils.indexOfAny("abcd", 'a', 'b', 'c', 'd'));
403+
assertEquals(0, StringUtils.indexOfAny("bcda", 'a', 'b', 'c', 'd'));
404+
assertEquals(0, StringUtils.indexOfAny("cbda", 'a', 'b', 'c', 'd'));
401405
}
402406

403407
/**

0 commit comments

Comments
 (0)