From 58d62fde4d3c735669193bc24d569615f5333c51 Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Thu, 3 Dec 2015 17:43:44 +0300 Subject: [PATCH] Add test for smart step into in method with default args #KT-4803 In Progress --- .../outs/smartStepIntoFunWithDefaultArgs.out | 17 ++++++++++ .../custom/smartStepIntoFunWithDefaultArgs.kt | 33 +++++++++++++++++++ .../debugger/KotlinSteppingTestGenerated.java | 6 ++++ 3 files changed, 56 insertions(+) create mode 100644 idea/testData/debugger/tinyApp/outs/smartStepIntoFunWithDefaultArgs.out create mode 100644 idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoFunWithDefaultArgs.kt diff --git a/idea/testData/debugger/tinyApp/outs/smartStepIntoFunWithDefaultArgs.out b/idea/testData/debugger/tinyApp/outs/smartStepIntoFunWithDefaultArgs.out new file mode 100644 index 00000000000..c8f8efaf349 --- /dev/null +++ b/idea/testData/debugger/tinyApp/outs/smartStepIntoFunWithDefaultArgs.out @@ -0,0 +1,17 @@ +LineBreakpoint created at smartStepIntoFunWithDefaultArgs.kt:17 +LineBreakpoint created at smartStepIntoFunWithDefaultArgs.kt:22 +LineBreakpoint created at smartStepIntoFunWithDefaultArgs.kt:27 +LineBreakpoint created at smartStepIntoFunWithDefaultArgs.kt:32 +!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! smartStepIntoFunWithDefaultArgs.SmartStepIntoFunWithDefaultArgsKt +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +smartStepIntoFunWithDefaultArgs.kt:17 +smartStepIntoFunWithDefaultArgs.kt:4 +smartStepIntoFunWithDefaultArgs.kt:22 +smartStepIntoFunWithDefaultArgs.kt:4 +smartStepIntoFunWithDefaultArgs.kt:27 +smartStepIntoFunWithDefaultArgs.kt:8 +smartStepIntoFunWithDefaultArgs.kt:32 +smartStepIntoFunWithDefaultArgs.kt:8 +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/smartStepIntoFunWithDefaultArgs.kt b/idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoFunWithDefaultArgs.kt new file mode 100644 index 00000000000..01448da1ce3 --- /dev/null +++ b/idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoFunWithDefaultArgs.kt @@ -0,0 +1,33 @@ +package smartStepIntoFunWithDefaultArgs + +fun Int.foo(a: Int = 1) { + val a = 1 +} + +fun Int.foo(a: String, b: Int = 1) { + val a = 1 +} + +fun bar() = 1 + +fun main(args: Array) { + // SMART_STEP_INTO_BY_INDEX: 2 + // RESUME: 1 + //Breakpoint! + bar().foo(2) + + // SMART_STEP_INTO_BY_INDEX: 2 + // RESUME: 1 + //Breakpoint! + bar().foo() + + // SMART_STEP_INTO_BY_INDEX: 2 + // RESUME: 1 + //Breakpoint! + bar().foo("1", 2) + + // SMART_STEP_INTO_BY_INDEX: 2 + // RESUME: 1 + //Breakpoint! + bar().foo("1") +} diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java index 2642b0e8247..c518270e866 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java @@ -571,6 +571,12 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { doCustomTest(fileName); } + @TestMetadata("smartStepIntoFunWithDefaultArgs.kt") + public void testSmartStepIntoFunWithDefaultArgs() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoFunWithDefaultArgs.kt"); + doCustomTest(fileName); + } + @TestMetadata("smartStepIntoInlinedFunLiteral.kt") public void testSmartStepIntoInlinedFunLiteral() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoInlinedFunLiteral.kt");