Reflection: add test on introspection of local classes

kotlin-reflect works correctly already for Kotlin-generated local
classes and anonymous objects, but not for Java ones. This is fixed in a
subsequent commit.

 #KT-41373 In Progress
This commit is contained in:
Alexander Udalov
2023-03-28 23:44:42 +02:00
committed by Space Team
parent 9fcdc10019
commit 1e031d9fb8
16 changed files with 345 additions and 0 deletions
@@ -32537,6 +32537,16 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/reflection/localClasses")
@TestDataPath("$PROJECT_ROOT")
public class LocalClasses {
@Test
public void testAllFilesPresentInLocalClasses() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/reflection/localClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/reflection/mapping")
@TestDataPath("$PROJECT_ROOT")
@@ -32537,6 +32537,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/reflection/localClasses")
@TestDataPath("$PROJECT_ROOT")
public class LocalClasses {
@Test
public void testAllFilesPresentInLocalClasses() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/reflection/localClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/reflection/mapping")
@TestDataPath("$PROJECT_ROOT")
@@ -32537,6 +32537,16 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/reflection/localClasses")
@TestDataPath("$PROJECT_ROOT")
public class LocalClasses {
@Test
public void testAllFilesPresentInLocalClasses() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/reflection/localClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/reflection/mapping")
@TestDataPath("$PROJECT_ROOT")