Fix confidence test - several results in completion because of Leda middle matching prevented completion auto-insert (Leda only)

This commit is contained in:
Nikolay Krasko
2012-07-25 16:00:58 +04:00
parent 53c30553a5
commit d97e26cdb9
2 changed files with 10 additions and 2 deletions
@@ -77,6 +77,7 @@ public class JetConfidenceTest extends LightCompletionTestCase {
@Override
protected void complete() {
new CodeCompletionHandlerBase(CompletionType.BASIC, false, true, true).invokeCompletion(getProject(), getEditor(), 0, false, false);
new CodeCompletionHandlerBase(CompletionType.BASIC, false, true, true).invokeCompletion(
getProject(), getEditor(), 0, false, true);
}
}
@@ -35,7 +35,7 @@ public class KeywordsHandlerTest extends LightCompletionTestCase {
public void testNoSpaceAfter() throws IOException {
configureFromFileText("Test.kt", "fun test() { nul<caret> }");
complete();
forceCompleteFirst();
checkResultByText("fun test() { null<caret> }");
}
@@ -65,6 +65,13 @@ public class KeywordsHandlerTest extends LightCompletionTestCase {
checkResultByFile(getTestName(false) + "_after.kt");
}
protected void forceCompleteFirst() {
complete();
if (myItems != null && myItems.length > 1) {
selectItem(myItems[0]);
}
}
@Override
protected String getTestDataPath() {
return new File(PluginTestCaseBase.getTestDataPathBase(), "/completion/handlers/keywords").getPath() +