From 6f7c0469ab3140d69db3841672fc06e3b842dca5 Mon Sep 17 00:00:00 2001 From: "xiaozihan.larryxiao" Date: Thu, 2 Mar 2023 15:51:46 +0800 Subject: [PATCH] Add test case for annotation value use single as array in java type --- test-utils/testData/api/javaAnnotatedUtil.kt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test-utils/testData/api/javaAnnotatedUtil.kt b/test-utils/testData/api/javaAnnotatedUtil.kt index e6da243a6b..30fcbb45bd 100644 --- a/test-utils/testData/api/javaAnnotatedUtil.kt +++ b/test-utils/testData/api/javaAnnotatedUtil.kt @@ -35,6 +35,9 @@ // Test: ParameterArraysTestAnnotationWithDefaultTest // IsPresent: class com.google.devtools.ksp.processor.ParameterArraysTestAnnotation // ByType: ParameterArraysTestAnnotation[booleanArrayValue=[true, false],byteArrayValue=[-2, 4],shortArrayValue=[-1, 2, 3],charArrayValue=[a, b, c],doubleArrayValue=[1.1, 2.2, 3.3],floatArrayValue=[1.0, 2.0, 3.3],intArrayValue=[1, 2, 4, 8, 16],longArrayValue=[1, 2, 4, 8, 16, 32],stringArrayValue=[first, second, third],kClassArrayValue=[class kotlin.Throwable, class com.google.devtools.ksp.processor.ParametersTestAnnotation],enumArrayValue=[VALUE1, VALUE2, VALUE1, VALUE2]] +// Test: ParameterArraysTestAnnotationWithSingleAsArrayTest +// IsPresent: class com.google.devtools.ksp.processor.ParameterArraysTestAnnotation +// ByType: ParameterArraysTestAnnotation[booleanArrayValue=[true],byteArrayValue=[-2],shortArrayValue=[-1],charArrayValue=[a],doubleArrayValue=[1.1],floatArrayValue=[1.0],intArrayValue=[1],longArrayValue=[1],stringArrayValue=[first],kClassArrayValue=[class kotlin.Throwable],enumArrayValue=[VALUE1]] // Test: AnnotationWithinAnAnnotationTest // IsPresent: class com.google.devtools.ksp.processor.OuterAnnotation // ByType: com.google.devtools.ksp.processor.OuterAnnotation[innerAnnotation=com.google.devtools.ksp.processor.InnerAnnotation[value=hello from the other side]] @@ -164,6 +167,22 @@ public class ParametersTestWithNegativeDefaultsAnnotationTest {} @Test public class ParameterArraysTestAnnotationWithDefaultTest {} +@ParameterArraysTestAnnotation( + booleanArrayValue = true, + byteArrayValue = -2, + shortArrayValue = -1, + charArrayValue = 'a', + doubleArrayValue = 1.1, + floatArrayValue = 1.0f, + intArrayValue = 1, + longArrayValue = 1L, + stringArrayValue = "first", + kClassArrayValue = java.lang.Throwable.class, + enumArrayValue = TestEnum.VALUE1 +) +@Test +public class ParameterArraysTestAnnotationWithSingleAsArrayTest {} + @OuterAnnotation(innerAnnotation = @InnerAnnotation(value = "hello from the other side")) @Test public class AnnotationWithinAnAnnotationTest {}