middle matching with uppercase prefix

This commit is contained in:
peter
2012-07-06 15:49:58 +02:00
parent 1902a516df
commit d62cac2b4c
2 changed files with 4 additions and 2 deletions
@@ -215,6 +215,8 @@ public class NameUtilTest extends UsefulTestCase {
}
public void testMiddleMatching() {
assertTrue(caseInsensitiveMatcher("*OLD").matches("folder"));
assertTrue(caseInsensitiveMatcher("*old").matches("folder"));
assertMatches("SWU*H*7", "SWUpgradeHdlrFSPR7Test");
assertMatches("SWU*H*R", "SWUpgradeHdlrFSPR7Test");
assertMatches("SWU*H*R", "SWUPGRADEHDLRFSPR7TEST");
@@ -222,7 +224,7 @@ public class NameUtilTest extends UsefulTestCase {
assertMatches("*Git", "GitBlaBla");
assertMatches("*git", "BlaGitBla");
assertMatches("*Git", "BlaGitBla");
assertDoesntMatch("*Git", "BlagitBla");
assertFalse(firstLetterMatcher("*Git").matches("BlagitBla"));
assertMatches("*git", "BlagitBla");
assertMatches("*Git*", "AtpGenerationItem");
assertMatches("Collec*Util*", "CollectionUtils");
@@ -193,7 +193,7 @@ public class MinusculeMatcher implements Matcher {
if (next < 0) {
break;
}
if (upper && next > 0 && !Character.isUpperCase(name.charAt(next))) {
if (upper && next > 0 && !Character.isUpperCase(name.charAt(next)) && myOptions != NameUtil.MatchingCaseSensitivity.NONE) {
fromIndex = next + 1;
continue;
}