Resolve arrays in annotation arguments

This commit is contained in:
Natalia.Ukhorskaya
2013-07-05 14:12:55 +04:00
parent dddec9ea3d
commit 98d3b1e113
4 changed files with 61 additions and 0 deletions
@@ -81,6 +81,24 @@ public class AnnotationDescriptorResolveTest extends JetLiteFixture {
doTest(content, expectedAnnotation);
}
public void testIntArrayAnnotation() throws IOException {
String content = getContent("AnnIntArray(intArray(1, 2))");
String expectedAnnotation = "AnnIntArray[a = [1.toInt(), 2.toInt()]]";
doTest(content, expectedAnnotation);
}
public void testStringArrayAnnotation() throws IOException {
String content = getContent("AnnStringArray(array(\"a\"))");
String expectedAnnotation = "AnnStringArray[a = [\"a\"]]";
doTest(content, expectedAnnotation);
}
public void testEnumArrayAnnotation() throws IOException {
String content = getContent("AnnArrayOfEnum(array(MyEnum.A))");
String expectedAnnotation = "AnnArrayOfEnum[a = [MyEnum.A]]";
doTest(content, expectedAnnotation);
}
private void doTest(@NotNull String content, @NotNull String expectedAnnotation) {
NamespaceDescriptor test = getNamespaceDescriptor(content);
ClassDescriptor myClass = getClassDescriptor(test, "MyClass");