Update tests
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
var res = ""
|
||||
|
||||
fun getM(): String {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
class CustomException : Throwable {
|
||||
constructor(message: String?, cause: Throwable?) : super(message, cause)
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
fun box(): String {
|
||||
try {
|
||||
throw Throwable("OK", null)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
fun box(): String {
|
||||
var t = Throwable("O", Throwable("K"))
|
||||
if (t.message != "O" || t.cause?.message != "K") return "fail1"
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
open class Base(message: String? = null, cause: Throwable? = null) : Throwable(message, cause)
|
||||
|
||||
open class Base2(message: String? = null, cause: Throwable? = null): Base(message, cause)
|
||||
|
||||
open class Override(message: String? = null, cause: Throwable? = null) : Base2(message, cause) {
|
||||
|
||||
var i = 0
|
||||
|
||||
override val message: String?
|
||||
get() = "Override: " + super.message + "${i++}"
|
||||
}
|
||||
|
||||
open class OverBase(message: String? = null, cause: Throwable? = null): Override(message, cause)
|
||||
|
||||
open class OverOverride(message: String? = null, cause: Throwable? = null) : OverBase(message, cause) {
|
||||
|
||||
override val message: String?
|
||||
get() = "OverOver: " + super.message + "${i++}"
|
||||
|
||||
override val cause: Throwable?
|
||||
get() = super.cause ?: this
|
||||
|
||||
}
|
||||
|
||||
|
||||
fun box(): String {
|
||||
check(Base("O", Base("K")), "OK")
|
||||
check(Override("OK"), "Override: OK0")
|
||||
check(OverOverride("OK"), "OverOver: Override: OK01OverOver: Override: OK23")
|
||||
return "OK"
|
||||
}
|
||||
|
||||
|
||||
fun check(t: Throwable, msg: String) {
|
||||
try {
|
||||
throw t
|
||||
} catch (e: Throwable) {
|
||||
val c = t.cause
|
||||
val m = if (c != null) t.message!! + c.message!! else t.message!!
|
||||
if (m != msg) throw AssertionError(m)
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
class MyThrowable(message: String? = null, cause: Throwable? = null) : Throwable(message, cause) {
|
||||
|
||||
override val message: String?
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
class MyThrowable : Throwable {
|
||||
val x: String
|
||||
|
||||
|
||||
+5
@@ -21768,6 +21768,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableCause.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableComplex.kt")
|
||||
public void testThrowableComplex() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableComplex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableImpl.kt")
|
||||
public void testThrowableImpl() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableImpl.kt");
|
||||
|
||||
+5
@@ -21768,6 +21768,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableCause.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableComplex.kt")
|
||||
public void testThrowableComplex() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableComplex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableImpl.kt")
|
||||
public void testThrowableImpl() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableImpl.kt");
|
||||
|
||||
+5
@@ -21773,6 +21773,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableCause.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableComplex.kt")
|
||||
public void testThrowableComplex() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableComplex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableImpl.kt")
|
||||
public void testThrowableImpl() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableImpl.kt");
|
||||
|
||||
+5
@@ -19588,6 +19588,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableCause.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableComplex.kt")
|
||||
public void testThrowableComplex() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableComplex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableImpl.kt")
|
||||
public void testThrowableImpl() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableImpl.kt");
|
||||
|
||||
+5
@@ -20633,6 +20633,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableCause.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableComplex.kt")
|
||||
public void testThrowableComplex() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableComplex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableImpl.kt")
|
||||
public void testThrowableImpl() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/specialBuiltins/throwableImpl.kt");
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// EXPECTED_REACHABLE_NODES: 1291
|
||||
package foo
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// EXPECTED_REACHABLE_NODES: 1286
|
||||
package foo
|
||||
|
||||
|
||||
Reference in New Issue
Block a user