Move debugger test data to the new location
This commit is contained in:
+39
@@ -0,0 +1,39 @@
|
||||
// Should stop on primary constructor invocation
|
||||
class Foo1(val a: Int) /// M
|
||||
|
||||
class Foo2( /// M
|
||||
val a: Int, /// F
|
||||
val b: String /// F
|
||||
)
|
||||
|
||||
class Foo3(val a: Int) { /// M
|
||||
constructor(a: String) : this(a.toInt()) /// M
|
||||
}
|
||||
|
||||
// Initializers are not currently recognized as functions
|
||||
class Foo4 { /// M
|
||||
init { /// L
|
||||
println() /// L
|
||||
} /// L
|
||||
}
|
||||
|
||||
class Foo5 {
|
||||
constructor(a: String) {} /// M
|
||||
constructor(a: Int) {} /// M
|
||||
}
|
||||
|
||||
interface Intf
|
||||
|
||||
annotation class Anno
|
||||
|
||||
enum class Enum1 { /// M
|
||||
FOO
|
||||
}
|
||||
|
||||
enum class Enum2(val a: Int) { /// M
|
||||
FOO(1)
|
||||
}
|
||||
|
||||
object Obj1
|
||||
|
||||
object Obj2 {}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
// Simple one-liners should have only method breakpoint
|
||||
// Simple = no lambdas on a line
|
||||
fun foo1() = println() /// M
|
||||
|
||||
fun foo2() {} /// M
|
||||
|
||||
// Lambdas should be available if present
|
||||
fun foo3() = run { println() } /// *, L, M, λ
|
||||
|
||||
// Code blocks {} are not considered as expressions
|
||||
fun foo4() { /// M
|
||||
println() /// L
|
||||
} /// L
|
||||
|
||||
// And parenthesis as well
|
||||
fun foo5() = ( /// M
|
||||
println() /// L
|
||||
)
|
||||
|
||||
// For expression-body functions, a line breakpoint should be available
|
||||
// if there is an expression on the first line
|
||||
fun foo6() = when (2 + 3) { /// M, L
|
||||
5 -> {} /// L
|
||||
else -> {} /// L
|
||||
}
|
||||
|
||||
// Line breakpoint should not be displayed for lambda literal results
|
||||
fun foo7() = { println() } /// M, λ
|
||||
|
||||
fun foo8() = (3 + 5).run { /// M, L
|
||||
println() /// L
|
||||
} /// L
|
||||
|
||||
// Expressions in default parameter values should be recognized
|
||||
fun foo9(a: String = readLine()!!) = a /// M, L
|
||||
|
||||
// Lambdas in default parameter values also should be recognized
|
||||
fun foo10(a: () -> Unit = { println() }) { /// *, L, M, λ
|
||||
a() /// L
|
||||
} /// L
|
||||
|
||||
// If a default parameter value is not just a lambda, but a function call with a lambda argument,
|
||||
// there should be a line breakpoint as well
|
||||
fun foo11(a: String = run { "foo" }) = a /// *, L, M, λ
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
fun foo() {
|
||||
require(true) { "foo" } /// *, L, λ
|
||||
|
||||
require(true) { val a = 5 } /// *, L, λ
|
||||
|
||||
require(true) { /// L
|
||||
val a = 5 /// L
|
||||
} /// L
|
||||
|
||||
block { val a = 5 } /// *, L, λ
|
||||
|
||||
block { /// L
|
||||
val a = 5 /// L
|
||||
} /// L
|
||||
|
||||
inlineBlock { val a = 5} /// *, L, λ
|
||||
|
||||
inlineBlock { /// L
|
||||
val a = 5 /// L
|
||||
} /// L
|
||||
|
||||
inlineOnlyBlock { val a = 5 } /// *, L, λ
|
||||
|
||||
inlineOnlyBlock { /// L
|
||||
val a = 5 /// L
|
||||
} /// L
|
||||
|
||||
inlineOnlyBlock2 { val a = 5 } /// *, L, λ
|
||||
|
||||
inlineOnlyBlock2 { /// L
|
||||
val a = 5 /// L
|
||||
} /// L
|
||||
} /// L
|
||||
|
||||
private fun block(block: () -> Unit) { /// M
|
||||
block() /// L
|
||||
} /// L
|
||||
|
||||
private inline fun inlineBlock(block: () -> Unit) { /// M
|
||||
block() /// L
|
||||
} /// L
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.InlineOnly
|
||||
private inline fun inlineOnlyBlock(block: () -> Unit) {
|
||||
block()
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.InlineOnly
|
||||
private inline fun inlineOnlyBlock2(noinline block: () -> Unit) {
|
||||
block()
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
fun foo1() {
|
||||
// We don't support function breakpoints for local functions yet
|
||||
fun local() { /// L
|
||||
println() /// L
|
||||
} /// L
|
||||
} /// L
|
||||
|
||||
fun foo2() { /// M
|
||||
val local = fun() { /// L
|
||||
println() /// L
|
||||
} /// L
|
||||
} /// L
|
||||
|
||||
fun foo3() { /// M
|
||||
val local = { /// L
|
||||
println() /// L
|
||||
} /// L
|
||||
} /// L
|
||||
|
||||
fun foo4() { /// M
|
||||
fun local(block: () -> Unit = { println() }) {} /// *, L, λ
|
||||
} /// L
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Foo1 {
|
||||
val x: String /// F, L
|
||||
get() = "foo" /// M
|
||||
}
|
||||
|
||||
class Foo2 { /// M
|
||||
val x: String = "foo" /// F, L
|
||||
get() = field + "x" /// M
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package simple
|
||||
|
||||
fun main() { /// M
|
||||
val a = 5 /// L
|
||||
foo(a) /// L
|
||||
} /// L
|
||||
|
||||
fun foo(a: Int) { /// M
|
||||
val b = 6 /// L
|
||||
} /// L
|
||||
Reference in New Issue
Block a user