Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classes that import junit.framework are not considered a test case #2383

Closed
blueguy opened this issue Nov 27, 2023 · 1 comment · Fixed by #2386
Closed

Classes that import junit.framework are not considered a test case #2383

blueguy opened this issue Nov 27, 2023 · 1 comment · Fixed by #2386

Comments

@blueguy
Copy link

blueguy commented Nov 27, 2023

Expected Behavior

With the promotion of function naming I now see errors like "Function name should start with a lowercase letter (except factory methods) and use camel case" even though this is within a test. In my test case, junit (junit.framework and org.junit) is used for tests. I found ktlint does not recognized as test file with "junit.framework" So, expected behavior would be that kind of test file recognized as test file.

Current Behavior

The following test case is considered to have an invalid function name. According to Function naming tests are considered to have an import of org.junit, org.testng or kotlin.test, but this example doesn't have any.

package some.package

import junit.framework.TestCase

class ArgumentParserTest : TestCase() {
    fun testParser_filterKeyVelye() {
    }
}

Additional information

  • Current version of ktlint: 1.0.1
@paul-dingemans
Copy link
Collaborator

I have never heard of junit.framework.TestCase. According to this stackoverflow question is a relic of JUnit3. But adding it, is no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants