From 441e72abed0b555f50fbc283bb3cf50906557d76 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Tue, 23 Jun 2015 20:27:38 +0300 Subject: [PATCH] kapt: Add class declarations test in AP wrapper --- .../kotlin/annotation/AnnotationListParseTest.kt | 9 ++++++--- .../resources/parse/classDeclarations/annotations.txt | 5 +++++ .../test/resources/parse/classDeclarations/parsed.txt | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 libraries/tools/kotlin-annotation-processing/src/test/resources/parse/classDeclarations/annotations.txt create mode 100644 libraries/tools/kotlin-annotation-processing/src/test/resources/parse/classDeclarations/parsed.txt diff --git a/libraries/tools/kotlin-annotation-processing/src/test/kotlin/org/jetbrains/kotlin/annotation/AnnotationListParseTest.kt b/libraries/tools/kotlin-annotation-processing/src/test/kotlin/org/jetbrains/kotlin/annotation/AnnotationListParseTest.kt index b7565f2628b..906c3c6d2a9 100644 --- a/libraries/tools/kotlin-annotation-processing/src/test/kotlin/org/jetbrains/kotlin/annotation/AnnotationListParseTest.kt +++ b/libraries/tools/kotlin-annotation-processing/src/test/kotlin/org/jetbrains/kotlin/annotation/AnnotationListParseTest.kt @@ -32,6 +32,8 @@ public class AnnotationListParseTest { Test fun testSimple() = doTest("simple") + Test fun testDeclarations() = doTest("classDeclarations") + private val resourcesRootFile = File("src/test/resources/parse") @@ -59,10 +61,11 @@ public class AnnotationListParseTest { } } - val actualAnnotationsSorted = actualAnnotations.toString() - .lines().filter { it.isNotEmpty() }.sort().joinToString("\n") + val actualAnnotationsSorted = actualAnnotations.toString().lines().filter { it.isNotEmpty() }.sort() + val classDeclarationsSorted = annotationProvider.kotlinClasses.sort() - assertEqualsToFile(expectedFile, actualAnnotationsSorted) + val fileContents = (actualAnnotationsSorted + classDeclarationsSorted).joinToString("\n") + assertEqualsToFile(expectedFile, fileContents) } // JetTestUtils.assertEqualsToFile() is not reachable from here diff --git a/libraries/tools/kotlin-annotation-processing/src/test/resources/parse/classDeclarations/annotations.txt b/libraries/tools/kotlin-annotation-processing/src/test/resources/parse/classDeclarations/annotations.txt new file mode 100644 index 00000000000..583f2226280 --- /dev/null +++ b/libraries/tools/kotlin-annotation-processing/src/test/resources/parse/classDeclarations/annotations.txt @@ -0,0 +1,5 @@ +p example 0 +d 0/TestClass +a example.ExampleAnnotation 0 +c 0 0/TestClass +d 0/AncestorClass \ No newline at end of file diff --git a/libraries/tools/kotlin-annotation-processing/src/test/resources/parse/classDeclarations/parsed.txt b/libraries/tools/kotlin-annotation-processing/src/test/resources/parse/classDeclarations/parsed.txt new file mode 100644 index 00000000000..a8f1156e72a --- /dev/null +++ b/libraries/tools/kotlin-annotation-processing/src/test/resources/parse/classDeclarations/parsed.txt @@ -0,0 +1,3 @@ +example.ExampleAnnotation example.TestClass +example.AncestorClass +example.TestClass \ No newline at end of file