Debugger: Tests refactor
This commit is contained in:
committed by
Vladimir Ilmov
parent
12313fa5aa
commit
1dc44b4000
+20
@@ -0,0 +1,20 @@
|
||||
package frameLambdaNotAccessible
|
||||
|
||||
fun main() {
|
||||
val k = "lorem"
|
||||
bar()()
|
||||
}
|
||||
|
||||
fun bar(): () -> Unit {
|
||||
val k = "ipsum"
|
||||
return {
|
||||
val l = "doloret"
|
||||
//Breakpoint!
|
||||
Unit
|
||||
}
|
||||
}
|
||||
|
||||
// PRINT_FRAME
|
||||
|
||||
// EXPRESSION: k
|
||||
// RESULT: 'k' is not captured
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
LineBreakpoint created at frameLambdaNotAccessible.kt:13
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
frameLambdaNotAccessible.kt:13
|
||||
Compile bytecode for k
|
||||
frame = invoke:13, FrameLambdaNotAccessibleKt$bar$1 {frameLambdaNotAccessible}
|
||||
this = this = {frameLambdaNotAccessible.FrameLambdaNotAccessibleKt$bar$1@uniqueID}Function0<kotlin.Unit>
|
||||
field = arity: int = 0 (sp = Lambda.!EXT!)
|
||||
local = l: java.lang.String = doloret (sp = frameLambdaNotAccessible.kt, 11)
|
||||
field = value: char[] = {char[7]@uniqueID} (sp = String.!EXT!)
|
||||
element = 0 = 'd' 100
|
||||
element = 1 = 'o' 111
|
||||
element = 2 = 'l' 108
|
||||
element = 3 = 'o' 111
|
||||
element = 4 = 'r' 114
|
||||
element = 5 = 'e' 101
|
||||
element = 6 = 't' 116
|
||||
field = hash: int = 0 (sp = String.!EXT!)
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package frameLambdaVariableFromCorrectFrame
|
||||
|
||||
fun main() {
|
||||
val k = "lorem"
|
||||
foo {
|
||||
val j = "ipsum"
|
||||
{
|
||||
val l = 5
|
||||
//Breakpoint!
|
||||
Unit
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(block: () -> Any?) {
|
||||
val k = "doloret"
|
||||
val j = "sit"
|
||||
block()
|
||||
}
|
||||
|
||||
// PRINT_FRAME
|
||||
|
||||
// EXPRESSION: k
|
||||
// RESULT: "lorem": Ljava/lang/String;
|
||||
|
||||
// EXPRESSION: j
|
||||
// RESULT: "ipsum": Ljava/lang/String;
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
LineBreakpoint created at frameLambdaVariableFromCorrectFrame.kt:10
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
frameLambdaVariableFromCorrectFrame.kt:10
|
||||
Compile bytecode for k
|
||||
Compile bytecode for j
|
||||
frame = invoke:10, FrameLambdaVariableFromCorrectFrameKt$main$1$1 {frameLambdaVariableFromCorrectFrame}
|
||||
this = this = {frameLambdaVariableFromCorrectFrame.FrameLambdaVariableFromCorrectFrameKt$main$1$1@uniqueID}Function0<kotlin.Unit>
|
||||
field = arity: int = 0 (sp = Lambda.!EXT!)
|
||||
local = l: int = 5 (sp = frameLambdaVariableFromCorrectFrame.kt, 8)
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package nonCapturedThisInLambda
|
||||
|
||||
fun main() {
|
||||
Foo().bar()
|
||||
}
|
||||
|
||||
class Foo {
|
||||
val a = "lorem"
|
||||
val b: String
|
||||
get() = "ipsum"
|
||||
fun bar() {
|
||||
{
|
||||
//Breakpoint!
|
||||
Unit
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
// PRINT_FRAME
|
||||
|
||||
// EXPRESSION: a
|
||||
// RESULT: "lorem": Ljava/lang/String;
|
||||
|
||||
// EXPRESSION: b
|
||||
// RESULT: "ipsum": Ljava/lang/String;
|
||||
|
||||
// EXPRESSION: this
|
||||
// RESULT: instance of nonCapturedThisInLambda.Foo(id=ID): LnonCapturedThisInLambda/Foo;
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
LineBreakpoint created at nonCapturedThisInLambda.kt:14
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
nonCapturedThisInLambda.kt:14
|
||||
Compile bytecode for a
|
||||
Compile bytecode for b
|
||||
Compile bytecode for this
|
||||
frame = invoke:14, Foo$bar$1 {nonCapturedThisInLambda}
|
||||
this = this = {nonCapturedThisInLambda.Foo$bar$1@uniqueID}Function0<kotlin.Unit>
|
||||
field = arity: int = 0 (sp = Lambda.!EXT!)
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package kt32691
|
||||
|
||||
fun main() {
|
||||
//Breakpoint!
|
||||
Unit
|
||||
}
|
||||
|
||||
class L<R, O>
|
||||
|
||||
// EXPRESSION: {}.toString()
|
||||
// RESULT: "kotlin.jvm.functions.Function0<kotlin.Unit>": Ljava/lang/String;
|
||||
|
||||
// EXPRESSION: {i: Int -> }.toString()
|
||||
// RESULT: "kotlin.jvm.functions.Function1<java.lang.Integer, kotlin.Unit>": Ljava/lang/String;
|
||||
|
||||
// EXPRESSION: {i: Int, d: Double -> "239" }.toString()
|
||||
// RESULT: "kotlin.jvm.functions.Function2<java.lang.Integer, java.lang.Double, java.lang.String>": Ljava/lang/String;
|
||||
|
||||
// EXPRESSION: {m : L<in String, out Int> -> ""}.toString()
|
||||
// RESULT: "kotlin.jvm.functions.Function1<kt32691.L<in java.lang.String, out java.lang.Integer>, java.lang.String>": Ljava/lang/String;
|
||||
|
||||
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
LineBreakpoint created at kt32691.kt:5
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
kt32691.kt:5
|
||||
Compile bytecode for {}.toString()
|
||||
Compile bytecode for {i: Int -> }.toString()
|
||||
Compile bytecode for {i: Int, d: Double -> "239" }.toString()
|
||||
Compile bytecode for {m : L<in String, out Int> -> ""}.toString()
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package kt33093
|
||||
|
||||
typealias foo = Nothing
|
||||
typealias bar = foo
|
||||
|
||||
fun main() {
|
||||
//Breakpoint!
|
||||
Unit
|
||||
}
|
||||
|
||||
// EXPRESSION: Nothing()
|
||||
// RESULT: Type 'Nothing' can't be instantiated
|
||||
|
||||
// EXPRESSION: foo()
|
||||
// RESULT: Type 'Nothing' can't be instantiated
|
||||
|
||||
// EXPRESSION: bar()
|
||||
// RESULT: Type 'Nothing' can't be instantiated
|
||||
|
||||
// EXPRESSION: { Nothing() }
|
||||
// RESULT: Type 'Nothing' can't be instantiated
|
||||
|
||||
// EXPRESSION: { bar() }
|
||||
// RESULT: Type 'Nothing' can't be instantiated
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
LineBreakpoint created at statements.kt:5
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
statements.kt:5
|
||||
Compile bytecode for val b = 1
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package kt33181
|
||||
|
||||
fun main() {
|
||||
Bar().foo()
|
||||
}
|
||||
|
||||
open class Foo {
|
||||
open fun foo(): Int {
|
||||
return 5
|
||||
}
|
||||
}
|
||||
|
||||
class Bar : Foo() {
|
||||
override fun foo(): Int {
|
||||
//Breakpoint!
|
||||
return 6
|
||||
}
|
||||
}
|
||||
|
||||
// EXPRESSION: super.foo()
|
||||
// RESULT: 5: I
|
||||
|
||||
// EXPRESSION: for (i in 1..1) { super.foo()}
|
||||
// RESULT: VOID_VALUE
|
||||
|
||||
// EXPRESSION: { super.foo() }
|
||||
// RESULT: Evaluation of 'super' calls inside lambdas and functions is not supported
|
||||
|
||||
// EXPRESSION: fun() { super.foo() }
|
||||
// RESULT: Evaluation of 'super' calls inside lambdas and functions is not supported
|
||||
|
||||
// EXPRESSION: if(true) { fun named() { super.foo() } } // hack to avoid "Anonymous functions with names are prohibited"
|
||||
// RESULT: Evaluation of 'super' calls inside lambdas and functions is not supported
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
LineBreakpoint created at kt33181.kt:16
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
kt33181.kt:16
|
||||
Compile bytecode for super.foo()
|
||||
Compile bytecode for for (i in 1..1) { super.foo()}
|
||||
Disconnected from the target VM
|
||||
|
||||
Process finished with exit code 0
|
||||
Reference in New Issue
Block a user