Rewrite some old exception filter tests
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
|||||||
|
fun box() {
|
||||||
|
null!!
|
||||||
|
}
|
||||||
|
|
||||||
|
// PREFIX: Breakpoint reached at
|
||||||
|
// FILE: breakpointReachedAt.kt
|
||||||
|
// LINE: 2
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
class A {
|
||||||
|
fun foo() {
|
||||||
|
null!!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() {
|
||||||
|
A().foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: kotlinClass.kt
|
||||||
|
// LINE: 3
|
||||||
+4
-1
@@ -1,6 +1,9 @@
|
|||||||
fun a() {
|
fun box() {
|
||||||
val f = {
|
val f = {
|
||||||
null!!
|
null!!
|
||||||
}
|
}
|
||||||
f()
|
f()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FILE: kt2489.kt
|
||||||
|
// LINE: 3
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
fun a() {
|
||||||
|
val f = {
|
||||||
|
null!!
|
||||||
|
}
|
||||||
|
f()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() {
|
||||||
|
a()
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: kt2489_2.kt
|
||||||
|
// LINE: 3
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package multiSameName
|
package multiSameName
|
||||||
|
|
||||||
fun foo(x: Int) {
|
fun box(x: Int) {
|
||||||
val f = { null!! }
|
val f = { null!! }
|
||||||
f()
|
f()
|
||||||
}
|
}
|
||||||
+4
-1
@@ -1,6 +1,9 @@
|
|||||||
package multiSameName
|
package multiSameName
|
||||||
|
|
||||||
fun foo() {
|
fun box() {
|
||||||
val f = { null!! }
|
val f = { null!! }
|
||||||
f()
|
f()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FILE: multiSamePackage.kt
|
||||||
|
// LINE: 4
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fun box(): String {
|
||||||
|
//Breakpoint!
|
||||||
|
null!!
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXCEPTION_TEXT: at SimpleKt.main(sss.kt:3)
|
||||||
|
// FILE: simple.kt
|
||||||
|
// LINE: 3
|
||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
fun main(args: Array<String>) {
|
|
||||||
println("hello")
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
class A {
|
|
||||||
fun foo() {
|
|
||||||
println("Hello!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
fun main(args: Array<String>) {
|
|
||||||
val f = {
|
|
||||||
null!!
|
|
||||||
}
|
|
||||||
f()
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
fun main(args: Array<String>) {
|
|
||||||
println("hello")
|
|
||||||
}
|
|
||||||
@@ -106,32 +106,6 @@ public class KotlinExceptionFilterTest : MultiFileTestCase() {
|
|||||||
TestCase.assertEquals(expectedOffset, descriptor.getOffset())
|
TestCase.assertEquals(expectedOffset, descriptor.getOffset())
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun testBreakpointReachedAt() {
|
|
||||||
doTest("breakpointReachedAt.kt", 2, { "BreakpointReachedAtKt" }, linePrefix = "Breakpoint reached at ")
|
|
||||||
}
|
|
||||||
|
|
||||||
public fun testSimple() {
|
|
||||||
doTest("simple.kt", 2, { "SimpleKt" })
|
|
||||||
}
|
|
||||||
|
|
||||||
public fun testKt2489() {
|
|
||||||
val packageFQN = FqName.ROOT
|
|
||||||
doTest("a.kt", 3, { file -> "" + PackagePartClassUtils.getDefaultFileClassFqName(packageFQN, file) + "\$a\$f\$1" })
|
|
||||||
doTest("main.kt", 3, { file -> "" + PackagePartClassUtils.getDefaultFileClassFqName(packageFQN, file) + "\$main\$f\$1" })
|
|
||||||
}
|
|
||||||
|
|
||||||
public fun testMultiSameName() {
|
|
||||||
val packageFQN = FqName("multiSameName")
|
|
||||||
// The order and the exact names do matter here
|
|
||||||
doTest("1/foo1.kt", 4, { file -> "" + PackagePartClassUtils.getDefaultFileClassFqName(packageFQN, file) + "\$foo\$f\$1" })
|
|
||||||
doTest("2/foo2.kt", 4, { file -> "" + PackagePartClassUtils.getDefaultFileClassFqName(packageFQN, file) + "\$foo\$f\$1" })
|
|
||||||
}
|
|
||||||
|
|
||||||
public fun testKotlinClass() {
|
|
||||||
val kotlinClassFqName = "A"
|
|
||||||
doTest("a.kt", 3, { kotlinClassFqName })
|
|
||||||
}
|
|
||||||
|
|
||||||
public fun testLibrarySources() {
|
public fun testLibrarySources() {
|
||||||
val mockLibrary = MockLibraryUtil.compileLibraryToJar(getTestDataPath() + getTestRoot() + "mockLibrary", "mockLibrary", true)
|
val mockLibrary = MockLibraryUtil.compileLibraryToJar(getTestDataPath() + getTestRoot() + "mockLibrary", "mockLibrary", true)
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ public class KotlinExceptionFilterTestGenerated extends AbstractKotlinExceptionF
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/exceptionFilter"), Pattern.compile("^([^\\.]+)$"), false);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/exceptionFilter"), Pattern.compile("^([^\\.]+)$"), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("breakpointReachedAt")
|
||||||
|
public void testBreakpointReachedAt() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/exceptionFilter/breakpointReachedAt/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("inlineFunctionAnotherFile")
|
@TestMetadata("inlineFunctionAnotherFile")
|
||||||
public void testInlineFunctionAnotherFile() throws Exception {
|
public void testInlineFunctionAnotherFile() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/exceptionFilter/inlineFunctionAnotherFile/");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/exceptionFilter/inlineFunctionAnotherFile/");
|
||||||
@@ -46,4 +52,34 @@ public class KotlinExceptionFilterTestGenerated extends AbstractKotlinExceptionF
|
|||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/exceptionFilter/inlineFunctionSameFile/");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/exceptionFilter/inlineFunctionSameFile/");
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kotlinClass")
|
||||||
|
public void testKotlinClass() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/exceptionFilter/kotlinClass/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt2489")
|
||||||
|
public void testKt2489() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/exceptionFilter/kt2489/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt2489_2")
|
||||||
|
public void testKt2489_2() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/exceptionFilter/kt2489_2/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("multiSamePackage")
|
||||||
|
public void testMultiSamePackage() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/exceptionFilter/multiSamePackage/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("simple")
|
||||||
|
public void testSimple() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/debugger/exceptionFilter/simple/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user