From c8999c4141907e3b9506eca66d737b274f2a84ab Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Thu, 26 Jan 2017 16:48:35 +0300 Subject: [PATCH] Fix in test bad behaviour of smart step into for stored lambda When lambda is stored and not executed immediately, smart step into doesn't work. --- .../tinyApp/outs/smartStepIntoStoredLambda.out | 8 ++++++++ .../custom/smartStepIntoStoredLambda.kt | 17 +++++++++++++++++ .../debugger/KotlinSteppingTestGenerated.java | 6 ++++++ 3 files changed, 31 insertions(+) create mode 100644 idea/testData/debugger/tinyApp/outs/smartStepIntoStoredLambda.out create mode 100644 idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoStoredLambda.kt diff --git a/idea/testData/debugger/tinyApp/outs/smartStepIntoStoredLambda.out b/idea/testData/debugger/tinyApp/outs/smartStepIntoStoredLambda.out new file mode 100644 index 00000000000..ddf236d4d25 --- /dev/null +++ b/idea/testData/debugger/tinyApp/outs/smartStepIntoStoredLambda.out @@ -0,0 +1,8 @@ +LineBreakpoint created at smartStepIntoStoredLambda.kt:12 +!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! smartStepIntoStoredLambda.SmartStepIntoStoredLambdaKt +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +smartStepIntoStoredLambda.kt:12 +smartStepIntoStoredLambda.kt:16 +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoStoredLambda.kt b/idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoStoredLambda.kt new file mode 100644 index 00000000000..53afe59bb41 --- /dev/null +++ b/idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoStoredLambda.kt @@ -0,0 +1,17 @@ +package smartStepIntoStoredLambda + +fun foo(a: Any) {} + +fun store(a: () -> Unit): () -> Unit { + return a +} + +fun main(args: Array) { + // SMART_STEP_INTO_BY_INDEX: 2 + //Breakpoint! + val some = store() { + foo("hi") + } + + some() +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java index 2ef2f5fcf83..107c82b9173 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java @@ -1082,6 +1082,12 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { doCustomTest(fileName); } + @TestMetadata("smartStepIntoStoredLambda.kt") + public void testSmartStepIntoStoredLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoStoredLambda.kt"); + doCustomTest(fileName); + } + @TestMetadata("smartStepIntoSubClass.kt") public void testSmartStepIntoSubClass() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoSubClass.kt");