Skip to content

Commit

Permalink
Add test case for reported false positive - #1264
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbosch committed Oct 24, 2018
1 parent 728676c commit 1e2e6a4
Showing 1 changed file with 13 additions and 0 deletions.
Expand Up @@ -167,4 +167,17 @@ class UnusedImportsSpec : SubjectSpek<UnusedImports>({
assertThat(subject.lint(code)).isEmpty()
}
}

given("imports with aliases") {

it("should not report import as unused because the alias is used") {
val code = """
import ch.tutteli.kbox.forEachRemaining as foreachRemaining // otherwise we use jdk8
fun foo(){
listOf().iterator().foreachRemaining{}
}
"""
assertThat(subject.lint(code)).isEmpty()
}
}
})

0 comments on commit 1e2e6a4

Please sign in to comment.