Force insertion of the first completion for handler test (Leda only)

This commit is contained in:
Nikolay Krasko
2012-07-25 19:23:47 +04:00
parent 2a16ec0b0f
commit 27b22105b4
2 changed files with 14 additions and 4 deletions
@@ -89,14 +89,17 @@ public class CompletionHandlerTest extends LightCompletionTestCase {
configureByFileNoComplete(getBeforeFileName());
setType(type);
complete(time);
if (lookupString != null || tailText != null) {
complete(time);
LookupElement item = getExistentLookupElement(lookupString, tailText);
if (item != null) {
selectItem(item, '\t');
selectItem(item, '\n');
}
}
else {
forceCompleteFirst(time);
}
checkResultByFile(getAfterFileName());
}
@@ -164,4 +167,11 @@ public class CompletionHandlerTest extends LightCompletionTestCase {
protected Sdk getProjectJDK() {
return PluginTestCaseBase.jdkFromIdeaHome();
}
protected void forceCompleteFirst(int time) {
complete(time);
if (myItems != null && myItems.length > 1) {
selectItem(myItems[0]);
}
}
}
@@ -31,7 +31,7 @@ public class CompletionWeigherTest extends CompletionAutoPopupTestCase {
}
public void testTemplatesAndKeywordsFirst() {
doTest("va", "val ... = ...", "var ... = ...", "vararg", "private", "values", "variables");
doTest("va", "val ... = ...", "var ... = ...", "vararg", "values", "variables");
}
public void doTest(String type, @NonNls String... expected) {