mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
case-sensitive first letter shouldn't oblige to use humps everywhere
This commit is contained in:
@@ -372,11 +372,12 @@ public class NameUtilTest extends UsefulTestCase {
|
||||
}
|
||||
|
||||
public void testMinusculeFirstLetter() {
|
||||
assertTrue(new MinusculeMatcher("WebLogic", NameUtil.MatchingCaseSensitivity.FIRST_LETTER).matches("WebLogic"));
|
||||
assertFalse(new MinusculeMatcher("webLogic", NameUtil.MatchingCaseSensitivity.FIRST_LETTER).matches("WebLogic"));
|
||||
assertTrue(new MinusculeMatcher("cL", NameUtil.MatchingCaseSensitivity.FIRST_LETTER).matches("class"));
|
||||
assertTrue(new MinusculeMatcher("CL", NameUtil.MatchingCaseSensitivity.FIRST_LETTER).matches("Class"));
|
||||
assertFalse(new MinusculeMatcher("abc", NameUtil.MatchingCaseSensitivity.FIRST_LETTER).matches("_abc"));
|
||||
assertTrue(firstLetterMatcher("WebLogic").matches("WebLogic"));
|
||||
assertFalse(firstLetterMatcher("webLogic").matches("WebLogic"));
|
||||
assertTrue(firstLetterMatcher("cL").matches("class"));
|
||||
assertTrue(firstLetterMatcher("CL").matches("Class"));
|
||||
assertTrue(firstLetterMatcher("Cl").matches("CoreLoader"));
|
||||
assertFalse(firstLetterMatcher("abc").matches("_abc"));
|
||||
}
|
||||
|
||||
public void testMinusculeAllImportant() {
|
||||
|
||||
@@ -40,7 +40,7 @@ public class MinusculeMatcher implements Matcher {
|
||||
myPattern = StringUtil.trimEnd(pattern, "* ").toCharArray();
|
||||
for (int i = 0; i < myPattern.length; i++) {
|
||||
char c = myPattern[i];
|
||||
if (Character.isUpperCase(c)) {
|
||||
if (Character.isUpperCase(c) && (i > 0 || myOptions != FIRST_LETTER)) {
|
||||
myHasHumps = true;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user