From 9594316b0a2ecc3aa0da5ad52a389307c00c80ad Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Tue, 4 Oct 2016 15:04:31 +0300 Subject: [PATCH] Test for "Breakpoint inside lambda argument of InlineOnly function doesn't work" (KT-11395) (cherry picked from commit d0ffe06) #KT-11395 Fixed --- .../noParameterLambdaArgumentCallInLambda.out | 8 ++++++++ .../noParameterLambdaArgumentCallInLambda.kt | 16 ++++++++++++++++ .../debugger/KotlinSteppingTestGenerated.java | 6 ++++++ 3 files changed, 30 insertions(+) create mode 100644 idea/testData/debugger/tinyApp/outs/noParameterLambdaArgumentCallInLambda.out create mode 100644 idea/testData/debugger/tinyApp/src/stepping/stepOver/noParameterLambdaArgumentCallInLambda.kt diff --git a/idea/testData/debugger/tinyApp/outs/noParameterLambdaArgumentCallInLambda.out b/idea/testData/debugger/tinyApp/outs/noParameterLambdaArgumentCallInLambda.out new file mode 100644 index 00000000000..47cacb71082 --- /dev/null +++ b/idea/testData/debugger/tinyApp/outs/noParameterLambdaArgumentCallInLambda.out @@ -0,0 +1,8 @@ +LineBreakpoint created at noParameterLambdaArgumentCallInLambda.kt:9 lambdaOrdinal = 1 +!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! noParameterLambdaArgumentCallInLambda.NoParameterLambdaArgumentCallInLambdaKt +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +noParameterLambdaArgumentCallInLambda.kt:9 +noParameterLambdaArgumentCallInLambda.kt:10 +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/stepOver/noParameterLambdaArgumentCallInLambda.kt b/idea/testData/debugger/tinyApp/src/stepping/stepOver/noParameterLambdaArgumentCallInLambda.kt new file mode 100644 index 00000000000..da9f5e07eff --- /dev/null +++ b/idea/testData/debugger/tinyApp/src/stepping/stepOver/noParameterLambdaArgumentCallInLambda.kt @@ -0,0 +1,16 @@ +package noParameterLambdaArgumentCallInLambda + +/* + KT-11395 Breakpoint inside lambda argument of InlineOnly function doesn't work + */ + +fun main(args: Array) { + //Breakpoint! (lambdaOrdinal = 1) + foo { val a = 11 } // Breakpoint inside lambda argument +} + +inline fun foo(s: () -> Unit) { + val x = 22 + s() + val y = 33 +} \ 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 c7138ec93fb..f2e972b7a7b 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java @@ -439,6 +439,12 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { doStepOverTest(fileName); } + @TestMetadata("noParameterLambdaArgumentCallInLambda.kt") + public void testNoParameterLambdaArgumentCallInLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepOver/noParameterLambdaArgumentCallInLambda.kt"); + doStepOverTest(fileName); + } + @TestMetadata("stepOverCatchClause.kt") public void testStepOverCatchClause() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverCatchClause.kt");