[box-tests] Added test
This commit is contained in:
+6
@@ -14298,6 +14298,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initEntriesInCompanionObject2.kt")
|
||||
public void testInitEntriesInCompanionObject2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initEntriesInValueOf.kt")
|
||||
public void testInitEntriesInValueOf() throws Exception {
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND: WASM
|
||||
|
||||
var l = ""
|
||||
|
||||
enum class Foo {
|
||||
FOO,
|
||||
BAR;
|
||||
init {
|
||||
l += "Foo.$name;"
|
||||
}
|
||||
|
||||
companion object {
|
||||
init {
|
||||
l += "Foo.CO;"
|
||||
}
|
||||
|
||||
val boo = 22
|
||||
}
|
||||
}
|
||||
|
||||
enum class Foo2 {
|
||||
FOO,
|
||||
BAR;
|
||||
|
||||
init {
|
||||
l += "Foo2.$name;"
|
||||
}
|
||||
|
||||
companion object {
|
||||
init {
|
||||
l += "Foo2.CO;"
|
||||
}
|
||||
|
||||
val boo = 22
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
try {
|
||||
enumValueOf<Foo>("NO")
|
||||
} catch (e: Throwable) {
|
||||
l += "caught;"
|
||||
}
|
||||
|
||||
if (l != "Foo.FOO;Foo.BAR;Foo.CO;caught;") return "Failure 0: l = $l"
|
||||
|
||||
l = ""
|
||||
enumValueOf<Foo2>("BAR")
|
||||
if (l != "Foo2.FOO;Foo2.BAR;Foo2.CO;") return "Failure 1: l = $l"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -14298,6 +14298,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initEntriesInCompanionObject2.kt")
|
||||
public void testInitEntriesInCompanionObject2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initEntriesInValueOf.kt")
|
||||
public void testInitEntriesInValueOf() throws Exception {
|
||||
|
||||
+6
@@ -14298,6 +14298,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initEntriesInCompanionObject2.kt")
|
||||
public void testInitEntriesInCompanionObject2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initEntriesInValueOf.kt")
|
||||
public void testInitEntriesInValueOf() throws Exception {
|
||||
|
||||
+5
@@ -11709,6 +11709,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initEntriesInCompanionObject2.kt")
|
||||
public void testInitEntriesInCompanionObject2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initEntriesInValueOf.kt")
|
||||
public void testInitEntriesInValueOf() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInValueOf.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -10483,6 +10483,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initEntriesInCompanionObject2.kt")
|
||||
public void testInitEntriesInCompanionObject2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initEntriesInValueOf.kt")
|
||||
public void testInitEntriesInValueOf() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInValueOf.kt");
|
||||
|
||||
Generated
+5
@@ -9894,6 +9894,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initEntriesInCompanionObject2.kt")
|
||||
public void testInitEntriesInCompanionObject2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initEntriesInValueOf.kt")
|
||||
public void testInitEntriesInValueOf() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInValueOf.kt");
|
||||
|
||||
Generated
+5
@@ -9894,6 +9894,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initEntriesInCompanionObject2.kt")
|
||||
public void testInitEntriesInCompanionObject2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initEntriesInValueOf.kt")
|
||||
public void testInitEntriesInValueOf() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInValueOf.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+5
@@ -4792,6 +4792,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initEntriesInCompanionObject2.kt")
|
||||
public void testInitEntriesInCompanionObject2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initEntriesInValueOf.kt")
|
||||
public void testInitEntriesInValueOf() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/initEntriesInValueOf.kt");
|
||||
|
||||
Reference in New Issue
Block a user