mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
middle matching in GrCompletionWithLibraryTest
This commit is contained in:
+4
-12
@@ -26,8 +26,6 @@ import com.intellij.testFramework.LightProjectDescriptor
|
||||
import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor
|
||||
import org.jetbrains.annotations.NotNull
|
||||
import org.jetbrains.plugins.groovy.util.TestUtils
|
||||
import com.intellij.codeInsight.completion.impl.CamelHumpMatcher
|
||||
|
||||
/**
|
||||
* @author Maxim.Medvedev
|
||||
*/
|
||||
@@ -42,12 +40,6 @@ class GrCompletionWithLibraryTest extends GroovyCompletionTestBase {
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void setUp() {
|
||||
super.setUp()
|
||||
CamelHumpMatcher.forceStartMatching(getTestRootDisposable());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected LightProjectDescriptor getProjectDescriptor() {
|
||||
@@ -60,9 +52,9 @@ class GrCompletionWithLibraryTest extends GroovyCompletionTestBase {
|
||||
}
|
||||
|
||||
public void testCategoryMethod() {doBasicTest()}
|
||||
public void testCategoryProperty() {doBasicTest()}
|
||||
public void testCategoryProperty() {doBasicTest('\n')}
|
||||
public void testMultipleCategories() {doBasicTest()}
|
||||
public void testCategoryForArray() {doBasicTest()}
|
||||
public void testCategoryForArray() {doBasicTest('\n')}
|
||||
|
||||
public void testArrayLikeAccessForList() throws Throwable {doBasicTest(); }
|
||||
public void testArrayLikeAccessForMap() throws Throwable {doBasicTest();}
|
||||
@@ -91,7 +83,7 @@ class GrCompletionWithLibraryTest extends GroovyCompletionTestBase {
|
||||
}
|
||||
|
||||
public void testIteratorNext() {
|
||||
doVariantableTest "next", "notify", "notifyAll"
|
||||
doHasVariantsTest('next', 'notify')
|
||||
}
|
||||
|
||||
public void testGstringExtendsString() {
|
||||
@@ -99,7 +91,7 @@ class GrCompletionWithLibraryTest extends GroovyCompletionTestBase {
|
||||
}
|
||||
|
||||
public void testCompletionInEachClosure() {
|
||||
myFixture.testCompletionVariants getTestName(false)+".groovy", "intValue", "intdiv", "intdiv"
|
||||
doHasVariantsTest('intValue', 'intdiv')
|
||||
}
|
||||
|
||||
public void testEllipsisTypeCompletion() {
|
||||
|
||||
+10
-2
@@ -40,8 +40,8 @@ abstract public class GroovyCompletionTestBase extends LightCodeInsightFixtureTe
|
||||
myFixture.checkResultByFile(getTestName(false) + "_after.groovy", true);
|
||||
}
|
||||
|
||||
protected void doBasicTest() {
|
||||
myFixture.testCompletion(getTestName(false) + ".groovy", getTestName(false) + "_after.groovy");
|
||||
protected void doBasicTest(String type = "") {
|
||||
myFixture.testCompletionTyping(getTestName(false) + ".groovy", type, getTestName(false) + "_after.groovy");
|
||||
}
|
||||
|
||||
protected void doBasicTest(String before, String after) {
|
||||
@@ -58,6 +58,14 @@ abstract public class GroovyCompletionTestBase extends LightCodeInsightFixtureTe
|
||||
assertOrderedEquals(myFixture.lookupElementStrings, variants);
|
||||
}
|
||||
|
||||
public void doHasVariantsTest(String... variants) {
|
||||
myFixture.configureByFile(getTestName(false) + ".groovy");
|
||||
myFixture.complete(CompletionType.BASIC);
|
||||
if (!myFixture.lookupElementStrings.containsAll(variants)) {
|
||||
assertOrderedEquals(myFixture.lookupElementStrings, variants)
|
||||
}
|
||||
}
|
||||
|
||||
public void doSmartCompletion(String... variants) {
|
||||
myFixture.configureByFile(getTestName(false) + ".groovy");
|
||||
myFixture.complete(CompletionType.SMART);
|
||||
|
||||
Reference in New Issue
Block a user