KT-32368 Rework Inline hints settings // migrate tests for lambdas
KotlinLambdasHintsProvider which in now responsible for lambda related hints is not compatible with the existing LambdaReturnValueHintsTest. Because of that tests were migrated to the new infrastructure.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// MODE: return
|
||||
@Target(AnnotationTarget.EXPRESSION)
|
||||
annotation class Some
|
||||
|
||||
fun test() {
|
||||
run {
|
||||
val files: Any? = null
|
||||
@Some
|
||||
12<# ^run #>
|
||||
}
|
||||
|
||||
run {
|
||||
val files: Any? = null
|
||||
@Some 12<# ^run #>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// MODE: off
|
||||
val x = run {
|
||||
println("foo")
|
||||
1
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// MODE: return
|
||||
fun foo() {
|
||||
run {
|
||||
val length: Int? = null
|
||||
length ?: 0<# ^run #>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// MODE: return
|
||||
val x = run {
|
||||
if (true) {
|
||||
1<# ^run #>
|
||||
} else {
|
||||
0<# ^run #>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// MODE: receivers_params
|
||||
val x = listOf("").filter {<# it: String #>
|
||||
it.startsWith("")
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
// MODE: receivers_params
|
||||
val x = listOf("").filter { it.startsWith(<hint text="prefix:" />"") }
|
||||
@@ -0,0 +1,4 @@
|
||||
// MODE: receivers_params
|
||||
val x = buildString { <hint text="this: StringBuilder" />
|
||||
append("foo")
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// MODE: return
|
||||
val x = run foo@{
|
||||
println("foo")
|
||||
1<# ^foo #>
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// MODE: return
|
||||
fun test() {
|
||||
run {
|
||||
val files: Any? = null
|
||||
run@
|
||||
12<# ^run #>
|
||||
}
|
||||
|
||||
run {
|
||||
val files: Any? = null
|
||||
run@12<# ^run #>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// MODE: return
|
||||
val x = run hello@{
|
||||
if (true) {
|
||||
}
|
||||
|
||||
run { // Two hints here
|
||||
when (true) {
|
||||
true -> 1<# ^run #>
|
||||
false -> 0<# ^run #>
|
||||
}
|
||||
}<# ^hello #>
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// MODE: return
|
||||
val x = run {
|
||||
1
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// MODE: return
|
||||
val x = run {
|
||||
println(1)
|
||||
if (true) 1 else { 0 }<# ^run #>
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// MODE: return
|
||||
fun bar() {
|
||||
var test = 0
|
||||
run {
|
||||
test
|
||||
test++<# ^run #>
|
||||
}
|
||||
|
||||
run {
|
||||
test
|
||||
++test<# ^run #>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// MODE: return
|
||||
val x = run {
|
||||
var s = "abc"
|
||||
s.length<# ^run #>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// MODE: return
|
||||
fun test() = run {
|
||||
val a = 1
|
||||
{ a }<# ^run #>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// MODE: return
|
||||
val x = run {
|
||||
println("foo")
|
||||
1<# ^run #>
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// MODE: return
|
||||
val x = run {
|
||||
when (true) {
|
||||
true -> 1<# ^run #>
|
||||
false -> 0<# ^run #>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user