aboutsummaryrefslogtreecommitdiff
path: root/core/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test')
-rw-r--r--core/src/test/kotlin/format/DacFormatTest.kt4
-rw-r--r--core/src/test/kotlin/javadoc/JavadocTest.kt6
-rw-r--r--core/src/test/kotlin/model/ClassTest.kt2
-rw-r--r--core/src/test/kotlin/model/FunctionTest.kt14
4 files changed, 22 insertions, 4 deletions
diff --git a/core/src/test/kotlin/format/DacFormatTest.kt b/core/src/test/kotlin/format/DacFormatTest.kt
index ae17420d4..5d8babc3d 100644
--- a/core/src/test/kotlin/format/DacFormatTest.kt
+++ b/core/src/test/kotlin/format/DacFormatTest.kt
@@ -51,4 +51,8 @@ class DacFormatTest: DacFormatTestCase() {
@Test fun javaClassLinks() {
verifyBothFormats("javaClassLinks")
}
+
+ @Test fun deprecation() {
+ verifyBothFormats("deprecation")
+ }
} \ No newline at end of file
diff --git a/core/src/test/kotlin/javadoc/JavadocTest.kt b/core/src/test/kotlin/javadoc/JavadocTest.kt
index 74265cbb8..a42d63933 100644
--- a/core/src/test/kotlin/javadoc/JavadocTest.kt
+++ b/core/src/test/kotlin/javadoc/JavadocTest.kt
@@ -16,8 +16,8 @@ class JavadocTest {
val type = method.returnType()
assertFalse(type.asClassDoc().isIncluded)
- assertEquals("java.lang.String", type.qualifiedTypeName())
- assertEquals("java.lang.String", type.asClassDoc().qualifiedName())
+ assertEquals("String", type.qualifiedTypeName())
+ assertEquals("String", type.asClassDoc().qualifiedName())
val params = method.parameters()
assertTrue(params[0].type().isPrimitive)
@@ -119,7 +119,7 @@ class JavadocTest {
val methodParamType = doc.classNamed("TypealiasesKt")!!.methods()
.find { it.name() == "some" }!!.parameters().first()
.type()
- assertEquals("kotlin.jvm.functions.Function1", methodParamType.qualifiedTypeName())
+ assertEquals("Function1", methodParamType.qualifiedTypeName())
assertEquals("? super A, C", methodParamType.asParameterizedType().typeArguments()
.map(Type::qualifiedTypeName).joinToString())
}
diff --git a/core/src/test/kotlin/model/ClassTest.kt b/core/src/test/kotlin/model/ClassTest.kt
index 56a38fd3d..6bc45db10 100644
--- a/core/src/test/kotlin/model/ClassTest.kt
+++ b/core/src/test/kotlin/model/ClassTest.kt
@@ -181,7 +181,7 @@ class ClassTest {
with(model.members.single().members.single()) {
with(deprecation!!) {
assertEquals("Deprecated", name)
- assertEquals(Content.Empty, content)
+ // assertEquals(Content.Empty, content) // this is now an empty MutableContent instead
assertEquals(NodeKind.Annotation, kind)
assertEquals(1, details.count())
with(details[0]) {
diff --git a/core/src/test/kotlin/model/FunctionTest.kt b/core/src/test/kotlin/model/FunctionTest.kt
index 329106829..c94d7e990 100644
--- a/core/src/test/kotlin/model/FunctionTest.kt
+++ b/core/src/test/kotlin/model/FunctionTest.kt
@@ -234,4 +234,18 @@ Documentation""", content.description.toTestString())
}
}
}
+
+ // Test for b/159470920, to ensure that we correctly parse annotated function types without resolving 'ERROR CLASS'
+ // types. Note that the actual annotation is not included in the type information, this is tracked in b/145517104.
+ @Test fun functionWithAnnotatedLambdaParam() {
+ verifyModel("testdata/functions/functionWithAnnotatedLambdaParam.kt") { model ->
+ with(model.members.single().members.single { it.name == "function" }) {
+ with(details(NodeKind.Parameter).first()) {
+ with(details(NodeKind.Type).first()) {
+ assertEquals("Function0", name)
+ }
+ }
+ }
+ }
+ }
}