Skip to content

Commit

Permalink
Ignore invalid function names when importing from "junit.framework" (#…
Browse files Browse the repository at this point in the history
…2386)

Closes #2383
  • Loading branch information
paul-dingemans authored Nov 27, 2023
1 parent bfaa201 commit a72dc96
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ public class FunctionNamingRule :
private val TEST_LIBRARIES_SET =
setOf(
"io.kotest",
"junit.framework",
"kotlin.test",
"org.junit",
"org.testng",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,18 @@ class FunctionNamingRuleTest {
""".trimIndent()
functionNamingRuleAssertThat(code).hasNoLintViolations()
}

@Test
fun `Issue 2383 - Given a class with tests in JUnit3 style`() {
val code =
"""
import junit.framework.TestCase
class FooTest : TestCase() {
fun testFoo_bar() {
}
}
""".trimIndent()
functionNamingRuleAssertThat(code).hasNoLintViolations()
}
}

0 comments on commit a72dc96

Please sign in to comment.