mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
IDEA-141826 Retrieve trigrams when doing regular expression based search
This commit is contained in:
@@ -76,6 +76,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
import static com.intellij.find.impl.FindInProjectUtil.buildStringToFindForIndicesFromRegExp;
|
||||
import static com.intellij.find.impl.FindInProjectUtil.createFileMaskCondition;
|
||||
|
||||
/**
|
||||
@@ -845,6 +846,12 @@ public class FindManagerTest extends DaemonAnalyzerTestCase {
|
||||
assertSize(0, findUsages(findModel));
|
||||
}
|
||||
|
||||
public void testRegexReplacementStringForIndices() {
|
||||
assertEquals("public static MyType my = 1;", buildStringToFindForIndicesFromRegExp("public static (@A)? MyType my\\w+? = 1;", myProject));
|
||||
assertEquals(" Foo ", buildStringToFindForIndicesFromRegExp("\\bFoo\\b", myProject));
|
||||
assertEquals("", buildStringToFindForIndicesFromRegExp("foo|bar", myProject));
|
||||
}
|
||||
|
||||
public void testCreateFileMaskCondition() {
|
||||
final Condition<String> condition = createFileMaskCondition("*.java, *.js, !Foo.java, !*.min.js");
|
||||
assertTrue(condition.value("Bar.java"));
|
||||
|
||||
Reference in New Issue
Block a user