Skip to content

Commit

Permalink
Ksp: Write test for nested java interface and disable for KSP.
Browse files Browse the repository at this point in the history
KSP is broken: google/ksp#1034
Fixed in 1.0.7.
  • Loading branch information
Jeffset committed Sep 15, 2022
1 parent c4d34cd commit 9e8d507
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions testing/src/test/kotlin/CoreBindingsTest.kt
@@ -1,5 +1,6 @@
package com.yandex.daggerlite.testing

import org.junit.Assume.assumeFalse
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -491,6 +492,30 @@ class CoreBindingsTest(
compileRunAndValidate()
}

@Test
fun `java component declaration with builder and nested dependency`() {
// KSP is broken: https://github.com/google/ksp/issues/1034
assumeFalse(backendUnderTest == Backend.Ksp) // TODO: revisit in KSP 1.0.7

givenJavaSource("test.TestComponent", """
import com.yandex.daggerlite.Component;
@Component(dependencies = {TestComponent.Dependency.class})
public interface TestComponent {
interface Dependency {
int provideInt();
}
@Component.Builder
interface Builder {
TestComponent create(Dependency dep);
}
}
""".trimIndent())

compileRunAndValidate()
}

@Test
fun `basic members inject`() {
givenJavaSource("test.ClassA", """
Expand Down

0 comments on commit 9e8d507

Please sign in to comment.