Completion: add tests for case with overloaded function with lambda with receiver parameter

Relates to #KT-31073
This commit is contained in:
Dmitry Gridin
2019-09-23 23:20:26 +07:00
parent e3ce799993
commit 5dddc464a5
6 changed files with 60 additions and 0 deletions
@@ -0,0 +1,10 @@
package foo
fun <R> bar(block: () -> R): R = TODO()
fun <T, R> T.bar(block: T.() -> R): R = TODO()
class X {
val b = ba<caret>
}
// TAIL_TEXT: " {...} (block: X.() -> R) for T in foo"
@@ -0,0 +1,10 @@
package foo
fun <R> bar(block: () -> R): R = TODO()
fun <T, R> T.bar(block: T.() -> R): R = TODO()
class X {
val b = bar { }
}
// TAIL_TEXT: " {...} (block: X.() -> R) for T in foo"
@@ -0,0 +1,10 @@
package foo
fun <R> bar(block: () -> R): R = TODO()
fun <T, R> T.bar(block: T.() -> R): R = TODO()
class X {
val b = ba<caret>
}
// TAIL_TEXT: " {...} (block: () -> R) (foo)"
@@ -0,0 +1,10 @@
package foo
fun <R> bar(block: () -> R): R = TODO()
fun <T, R> T.bar(block: T.() -> R): R = TODO()
class X {
val b = foo.bar { }
}
// TAIL_TEXT: " {...} (block: () -> R) (foo)"
@@ -164,6 +164,16 @@ public class BasicCompletionHandlerTestGenerated extends AbstractBasicCompletion
runTest("idea/idea-completion/testData/handlers/basic/PreferMatchingKeyword.kt"); runTest("idea/idea-completion/testData/handlers/basic/PreferMatchingKeyword.kt");
} }
@TestMetadata("ReceiverParam.kt")
public void testReceiverParam() throws Exception {
runTest("idea/idea-completion/testData/handlers/basic/ReceiverParam.kt");
}
@TestMetadata("ReceiverParam2.kt")
public void testReceiverParam2() throws Exception {
runTest("idea/idea-completion/testData/handlers/basic/ReceiverParam2.kt");
}
@TestMetadata("ReplaceFunctionCallByProperty.kt") @TestMetadata("ReplaceFunctionCallByProperty.kt")
public void testReplaceFunctionCallByProperty() throws Exception { public void testReplaceFunctionCallByProperty() throws Exception {
runTest("idea/idea-completion/testData/handlers/basic/ReplaceFunctionCallByProperty.kt"); runTest("idea/idea-completion/testData/handlers/basic/ReplaceFunctionCallByProperty.kt");
@@ -164,6 +164,16 @@ public class PerformanceBasicCompletionHandlerTestGenerated extends AbstractPerf
runTest("idea/idea-completion/testData/handlers/basic/PreferMatchingKeyword.kt"); runTest("idea/idea-completion/testData/handlers/basic/PreferMatchingKeyword.kt");
} }
@TestMetadata("ReceiverParam.kt")
public void testReceiverParam() throws Exception {
runTest("idea/idea-completion/testData/handlers/basic/ReceiverParam.kt");
}
@TestMetadata("ReceiverParam2.kt")
public void testReceiverParam2() throws Exception {
runTest("idea/idea-completion/testData/handlers/basic/ReceiverParam2.kt");
}
@TestMetadata("ReplaceFunctionCallByProperty.kt") @TestMetadata("ReplaceFunctionCallByProperty.kt")
public void testReplaceFunctionCallByProperty() throws Exception { public void testReplaceFunctionCallByProperty() throws Exception {
runTest("idea/idea-completion/testData/handlers/basic/ReplaceFunctionCallByProperty.kt"); runTest("idea/idea-completion/testData/handlers/basic/ReplaceFunctionCallByProperty.kt");