Refactor debugger tests
1. Move tests to their own module 2. Avoid sharing the 'tinyApp' project between tests 3. Clean up option directive handling
This commit is contained in:
Vendored
+44
@@ -1,3 +1,4 @@
|
||||
// FILE: text.kt
|
||||
package isInsideInlineLambda
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
@@ -73,3 +74,46 @@ class A {
|
||||
// ADDITIONAL_BREAKPOINT: isInsideInlineLambdaInLibrary.kt:Breakpoint5:(1)
|
||||
// EXPRESSION: it + 15
|
||||
// RESULT: 20: I
|
||||
|
||||
// FILE: isInsideInlineLambdaInLibrary.kt
|
||||
package isInsideInlineLambdaInLibrary
|
||||
|
||||
public fun test() {
|
||||
val a = A()
|
||||
//Breakpoint1
|
||||
a.foo(1) { 1 }
|
||||
|
||||
// inside other lambda
|
||||
a.foo(100) {
|
||||
//Breakpoint2
|
||||
a.foo(2) { 1 }
|
||||
1
|
||||
}
|
||||
|
||||
// inside variable declaration
|
||||
//Breakpoint3
|
||||
val x = a.foo(3) { 1 }
|
||||
|
||||
// inside object declaration
|
||||
val y = object {
|
||||
fun foo() {
|
||||
//Breakpoint4
|
||||
a.foo(4) { 1 }
|
||||
}
|
||||
}
|
||||
y.foo()
|
||||
|
||||
// inside local function
|
||||
fun local() {
|
||||
//Breakpoint5
|
||||
a.foo(5) { 1 }
|
||||
}
|
||||
local()
|
||||
}
|
||||
|
||||
class A {
|
||||
inline fun foo(i: Int, f: (i: Int) -> Int): A {
|
||||
f(i)
|
||||
return this
|
||||
}
|
||||
}
|
||||
idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/isInsideInlineLambda.out
Vendored
+20
-20
@@ -1,34 +1,34 @@
|
||||
LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:6 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:11 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:17 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:23 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:31 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambda.kt:9 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambda.kt:17 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambda.kt:25 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambda.kt:33 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambda.kt:43 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:7 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:12 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:18 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:24 lambdaOrdinal = 1
|
||||
LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:32 lambdaOrdinal = 1
|
||||
LineBreakpoint created at text.kt:10 lambdaOrdinal = 1
|
||||
LineBreakpoint created at text.kt:18 lambdaOrdinal = 1
|
||||
LineBreakpoint created at text.kt:26 lambdaOrdinal = 1
|
||||
LineBreakpoint created at text.kt:34 lambdaOrdinal = 1
|
||||
LineBreakpoint created at text.kt:44 lambdaOrdinal = 1
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
isInsideInlineLambda.kt:9
|
||||
text.kt:10
|
||||
Compile bytecode for it + 1
|
||||
isInsideInlineLambda.kt:17
|
||||
text.kt:18
|
||||
Compile bytecode for it + 2
|
||||
isInsideInlineLambda.kt:25
|
||||
text.kt:26
|
||||
Compile bytecode for it + 3
|
||||
isInsideInlineLambda.kt:33
|
||||
text.kt:34
|
||||
Compile bytecode for it + 4
|
||||
isInsideInlineLambda.kt:43
|
||||
text.kt:44
|
||||
Compile bytecode for it + 5
|
||||
isInsideInlineLambdaInLibrary.kt:6
|
||||
isInsideInlineLambdaInLibrary.kt:7
|
||||
Compile bytecode for it + 11
|
||||
isInsideInlineLambdaInLibrary.kt:11
|
||||
isInsideInlineLambdaInLibrary.kt:12
|
||||
Compile bytecode for it + 12
|
||||
isInsideInlineLambdaInLibrary.kt:17
|
||||
isInsideInlineLambdaInLibrary.kt:18
|
||||
Compile bytecode for it + 13
|
||||
isInsideInlineLambdaInLibrary.kt:23
|
||||
isInsideInlineLambdaInLibrary.kt:24
|
||||
Compile bytecode for it + 14
|
||||
isInsideInlineLambdaInLibrary.kt:31
|
||||
isInsideInlineLambdaInLibrary.kt:32
|
||||
Compile bytecode for it + 15
|
||||
Disconnected from the target VM
|
||||
|
||||
|
||||
+85
-1
@@ -1,3 +1,4 @@
|
||||
// FILE: customLibClassName.kt
|
||||
package customLibClassName
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
@@ -26,4 +27,87 @@ fun main(args: Array<String>) {
|
||||
|
||||
// ADDITIONAL_BREAKPOINT: simpleLibFile.kt:public fun foo() {
|
||||
// EXPRESSION: 1 + 5
|
||||
// RESULT: 6: I
|
||||
// RESULT: 6: I
|
||||
|
||||
// FILE: lib/oneFunSameClassName/1/a1.kt
|
||||
@file:JvmName("SameNameOneFunSameFileName")
|
||||
@file:JvmMultifileClass
|
||||
package customLib.oneFunSameClassName
|
||||
|
||||
public fun oneFunSameFileNameFun(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
// FILE: lib/oneFunSameClassName/2/a2.kt
|
||||
@file:JvmName("SameNameOneFunSameFileName")
|
||||
@file:JvmMultifileClass
|
||||
package customLib.oneFunSameClassName
|
||||
|
||||
public fun oneFunSameFileNameFun2(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
// FILE: lib/twoFunDifferentSignature/1/a1.kt
|
||||
@file:JvmName("SameNameTwoFunDifferentSignature")
|
||||
@file:JvmMultifileClass
|
||||
package customLib.twoFunDifferentSignature
|
||||
|
||||
public fun twoFunDifferentSignatureFun(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
// FILE: lib/twoFunDifferentSignature/2/a2.kt
|
||||
@file:JvmName("SameNameTwoFunDifferentSignature")
|
||||
@file:JvmMultifileClass
|
||||
package customLib.twoFunDifferentSignature
|
||||
|
||||
public fun twoFunDifferentSignatureFun(i: Int): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
// FILE: lib/breakpointOnLocalProperty/1/a1.kt
|
||||
@file:JvmName("SameNameBreakpointOnLocalProperty")
|
||||
@file:JvmMultifileClass
|
||||
package customLib.breakpointOnLocalProperty
|
||||
|
||||
public fun breakpointOnLocalPropertyFun(): Int {
|
||||
val a = 1
|
||||
return 1
|
||||
}
|
||||
|
||||
// FILE: lib/breakpointOnLocalProperty/2/a2.kt
|
||||
@file:JvmName("SameNameBreakpointOnLocalProperty")
|
||||
@file:JvmMultifileClass
|
||||
package customLib.breakpointOnLocalProperty
|
||||
|
||||
public fun breakpointOnLocalPropertyFun2(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
// FILE: lib/property/1/a1.kt
|
||||
@file:JvmName("SameNameProperty")
|
||||
@file:JvmMultifileClass
|
||||
package customLib.property
|
||||
|
||||
public val foo: Int =
|
||||
1
|
||||
|
||||
// FILE: lib/property/2/a2.kt
|
||||
@file:JvmName("SameNameProperty")
|
||||
@file:JvmMultifileClass
|
||||
package customLib.property
|
||||
|
||||
public fun someFun(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
// FILE: lib/simpleLibFile/simpleLibFile.kt
|
||||
package customLib.simpleLibFile
|
||||
|
||||
public fun foo() {
|
||||
1 + 1
|
||||
}
|
||||
|
||||
class B {
|
||||
public var prop: Int = 1
|
||||
}
|
||||
+10
-10
@@ -1,19 +1,19 @@
|
||||
LineBreakpoint created at a1.kt:6
|
||||
LineBreakpoint created at a1.kt:6
|
||||
LineBreakpoint created at a1.kt:6
|
||||
LineBreakpoint created at a1.kt:6
|
||||
LineBreakpoint created at simpleLibFile.kt:4
|
||||
LineBreakpoint created at a1.kt:7
|
||||
LineBreakpoint created at a1.kt:7
|
||||
LineBreakpoint created at a1.kt:7
|
||||
LineBreakpoint created at a1.kt:7
|
||||
LineBreakpoint created at simpleLibFile.kt:5
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
a1.kt:6
|
||||
a1.kt:7
|
||||
Compile bytecode for 1 + 1
|
||||
a1.kt:6
|
||||
a1.kt:7
|
||||
Compile bytecode for 1 + 2
|
||||
a1.kt:6
|
||||
a1.kt:7
|
||||
Compile bytecode for 1 + 3
|
||||
a1.kt:6
|
||||
a1.kt:7
|
||||
Compile bytecode for 1 + 4
|
||||
simpleLibFile.kt:4
|
||||
simpleLibFile.kt:5
|
||||
Compile bytecode for 1 + 5
|
||||
Disconnected from the target VM
|
||||
|
||||
|
||||
+10
-1
@@ -1,3 +1,4 @@
|
||||
// FILE: test.kt
|
||||
package localFunInLibrary
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
@@ -6,4 +7,12 @@ fun main(args: Array<String>) {
|
||||
|
||||
// ADDITIONAL_BREAKPOINT: localFunCustomLib.kt:localFunInLibraryCustomLibProperty
|
||||
// EXPRESSION: localFun()
|
||||
// RESULT: 1: I
|
||||
// RESULT: 1: I
|
||||
|
||||
// FILE: localFunCustomLib.kt
|
||||
package customLib.localFunInLibraryCustomLib
|
||||
|
||||
public fun localFunInLibraryCustomLibMainFun() {
|
||||
fun localFun() = 1
|
||||
val localFunInLibraryCustomLibProperty = 1
|
||||
}
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
LineBreakpoint created at localFunCustomLib.kt:6
|
||||
LineBreakpoint created at localFunCustomLib.kt:7
|
||||
Run Java
|
||||
Connected to the target VM
|
||||
localFunCustomLib.kt:6
|
||||
localFunCustomLib.kt:7
|
||||
Compile bytecode for localFun()
|
||||
Disconnected from the target VM
|
||||
|
||||
|
||||
Reference in New Issue
Block a user