From df299655a7d2e42e045ca45b45fe8a01b5296464 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Thu, 17 Apr 2014 13:08:41 +0400 Subject: [PATCH] Smart completion: one more working test and one more test to fix later --- idea/testData/completion/smart/Lambda5.kt | 8 ++++++++ .../completion/smart/WrongCandidatesBug.kt.todo | 11 +++++++++++ .../completion/JvmSmartCompletionTestGenerated.java | 5 +++++ .../handlers/SmartCompletionHandlerTestGenerated.java | 10 ++++++++-- 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 idea/testData/completion/smart/Lambda5.kt create mode 100644 idea/testData/completion/smart/WrongCandidatesBug.kt.todo diff --git a/idea/testData/completion/smart/Lambda5.kt b/idea/testData/completion/smart/Lambda5.kt new file mode 100644 index 00000000000..2c940ce970d --- /dev/null +++ b/idea/testData/completion/smart/Lambda5.kt @@ -0,0 +1,8 @@ +fun foo(p: String.(Int) -> Unit){} + +fun bar() { + foo() +} + +// EXIST: "{...}" +// EXIST: "{ Int -> ... }" diff --git a/idea/testData/completion/smart/WrongCandidatesBug.kt.todo b/idea/testData/completion/smart/WrongCandidatesBug.kt.todo new file mode 100644 index 00000000000..1ef993e1b25 --- /dev/null +++ b/idea/testData/completion/smart/WrongCandidatesBug.kt.todo @@ -0,0 +1,11 @@ +class C { + fun foo(s: String){} +} + +fun foo(i: Int) { + val s = "" + C().foo() +} + +// ABSENT: i +// EXIST: s diff --git a/idea/tests/org/jetbrains/jet/completion/JvmSmartCompletionTestGenerated.java b/idea/tests/org/jetbrains/jet/completion/JvmSmartCompletionTestGenerated.java index c3013ddfdc4..c159ca610fe 100644 --- a/idea/tests/org/jetbrains/jet/completion/JvmSmartCompletionTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/completion/JvmSmartCompletionTestGenerated.java @@ -221,6 +221,11 @@ public class JvmSmartCompletionTestGenerated extends AbstractJvmSmartCompletionT doTest("idea/testData/completion/smart/Lambda4.kt"); } + @TestMetadata("Lambda5.kt") + public void testLambda5() throws Exception { + doTest("idea/testData/completion/smart/Lambda5.kt"); + } + @TestMetadata("MethodCallArgument.kt") public void testMethodCallArgument() throws Exception { doTest("idea/testData/completion/smart/MethodCallArgument.kt"); diff --git a/idea/tests/org/jetbrains/jet/completion/handlers/SmartCompletionHandlerTestGenerated.java b/idea/tests/org/jetbrains/jet/completion/handlers/SmartCompletionHandlerTestGenerated.java index b9ac485098f..076bc1e17e7 100644 --- a/idea/tests/org/jetbrains/jet/completion/handlers/SmartCompletionHandlerTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/completion/handlers/SmartCompletionHandlerTestGenerated.java @@ -16,11 +16,17 @@ package org.jetbrains.jet.completion.handlers; -import org.jetbrains.jet.JetTestUtils; -import org.jetbrains.jet.test.TestMetadata; +import junit.framework.Assert; +import junit.framework.Test; +import junit.framework.TestSuite; import java.io.File; import java.util.regex.Pattern; +import org.jetbrains.jet.JetTestUtils; +import org.jetbrains.jet.test.InnerTestClasses; +import org.jetbrains.jet.test.TestMetadata; + +import org.jetbrains.jet.completion.handlers.AbstractSmartCompletionHandlerTest; /** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all")