Tests for obsolete KT-4798, KT-7288, KT-7046
#KT-4798 Obsolete #KT-7288 Obsolete #KT-7046 Obsolete
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
|||||||
|
fun test(b: Boolean): String {
|
||||||
|
val a = if (b) IntArray(5) else LongArray(5)
|
||||||
|
if (a is IntArray) {
|
||||||
|
val x = a.iterator()
|
||||||
|
var i = 0
|
||||||
|
while (x.hasNext()) {
|
||||||
|
if (a[i] != x.next()) return "Fail $i"
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
return "OK"
|
||||||
|
} else if (a is LongArray) {
|
||||||
|
val x = a.iterator()
|
||||||
|
var i = 0
|
||||||
|
while (x.hasNext()) {
|
||||||
|
if (a[i] != x.next()) return "Fail $i"
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
return "fail"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
if (test(true) != "OK") return "fail 1: ${test(true)}"
|
||||||
|
|
||||||
|
if (test(false) != "OK") return "fail 1: ${test(false)}"
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fun box(): String {
|
||||||
|
val o = "OK" charAt 0
|
||||||
|
val array = CharArray(2)
|
||||||
|
array[1] = 'K'
|
||||||
|
val k = array get 1
|
||||||
|
|
||||||
|
return "$o$k"
|
||||||
|
}
|
||||||
+12
@@ -223,6 +223,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt7288.kt")
|
||||||
|
public void testKt7288() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt7288.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt779.kt")
|
@TestMetadata("kt779.kt")
|
||||||
public void testKt779() throws Exception {
|
public void testKt779() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt779.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/arrays/kt779.kt");
|
||||||
@@ -4348,6 +4354,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("infixCall.kt")
|
||||||
|
public void testInfixCall() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/infixCall.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("longRangeWithExplicitDot.kt")
|
@TestMetadata("longRangeWithExplicitDot.kt")
|
||||||
public void testLongRangeWithExplicitDot() throws Exception {
|
public void testLongRangeWithExplicitDot() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/longRangeWithExplicitDot.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/intrinsics/longRangeWithExplicitDot.kt");
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
LineBreakpoint created at kt7046localVarInInline.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 !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! kt7046localVarInInline.Kt7046localVarInInlinePackage
|
||||||
|
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
kt7046localVarInInline.kt:12
|
||||||
|
Compile bytecode for a*b
|
||||||
|
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
|
||||||
|
|
||||||
|
Process finished with exit code 0
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package kt7046localVarInInline
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
a(321) {
|
||||||
|
it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun a(a: Int, cb: (Int) -> Unit) {
|
||||||
|
val b = 123
|
||||||
|
//Breakpoint!
|
||||||
|
cb(a*b)
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPRESSION: a*b
|
||||||
|
// RESULT: 39483: I
|
||||||
+6
@@ -175,6 +175,12 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat
|
|||||||
doSingleBreakpointTest(fileName);
|
doSingleBreakpointTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt7046localVarInInline.kt")
|
||||||
|
public void testKt7046localVarInInline() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/kt7046localVarInInline.kt");
|
||||||
|
doSingleBreakpointTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("localVariables.kt")
|
@TestMetadata("localVariables.kt")
|
||||||
public void testLocalVariables() throws Exception {
|
public void testLocalVariables() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/localVariables.kt");
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/localVariables.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user