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

Separating positive and negative test cases for rules #527

Closed
schalkms opened this issue Oct 26, 2017 · 5 comments
Closed

Separating positive and negative test cases for rules #527

schalkms opened this issue Oct 26, 2017 · 5 comments
Assignees

Comments

@schalkms
Copy link
Member

At the moment the tests check the violation count.
However, there can be a case where the sum is correct and the findings are wrong.
Separating positive and negative test cases could help to minimize this problem.

@arturbosch
Copy link
Member

Which test cases do you have in mind? I'm not a fan of refactoring just because of refactoring. If the logic gets changed, we can change some test cases?

@schalkms
Copy link
Member Author

schalkms commented Nov 2, 2017

Consider the following test file example for checking the naming convention.

class MyClass {}//valid
class myclass {} // report
class myClass {} // report

Detekt's current test case checks the violation count. However, detekt does not check if the wrong MyClass classes are reported. There could be case where the right one gets reported.

@arturbosch
Copy link
Member

Ah now I understand. Yes, that makes sense and should be the preferred way.

@schalkms schalkms self-assigned this Nov 2, 2017
arturbosch pushed a commit that referenced this issue Nov 13, 2017
This separates positive and negative test cases for rules. (#527)
arturbosch pushed a commit that referenced this issue Nov 13, 2017
A violation was reported when an equals function was used as a global
function.
The test cases for this rule were refactored.
This separates positive and negative test cases for rules. (#527)
arturbosch pushed a commit that referenced this issue Nov 13, 2017
An interface can't contain a equals or hashCode function.
The test cases for this rule were refactored.
This separates positive and negative test cases for rules. (#527)
arturbosch pushed a commit that referenced this issue Nov 13, 2017
This separates positive and negative test cases for rules. (#527)
arturbosch pushed a commit that referenced this issue Nov 13, 2017
This separates positive and negative test cases for rules. (#527)
arturbosch pushed a commit that referenced this issue Nov 13, 2017
This separates positive and negative test cases for rules. (#527)
arturbosch pushed a commit that referenced this issue Nov 13, 2017
This separates positive and negative test cases for rules. (#527)
arturbosch pushed a commit that referenced this issue Nov 13, 2017
This separates positive and negative test cases for rules. (#527)
arturbosch pushed a commit that referenced this issue Nov 13, 2017
This separates positive and negative test cases for rules. (#527)
arturbosch pushed a commit that referenced this issue Nov 13, 2017
This separates positive and negative test cases for rules. (#527)
arturbosch pushed a commit that referenced this issue Nov 13, 2017
This separates positive and negative test cases for rules. (#527)
arturbosch pushed a commit that referenced this issue Nov 13, 2017
This refactored rules/style test cases.
This separates positive and negative test cases for rules. (#527)
arturbosch pushed a commit that referenced this issue Nov 13, 2017
This separates positive and negative test cases for rules. (#527)
@schalkms
Copy link
Member Author

Closed with 0d869e3

@lock
Copy link

lock bot commented Jun 20, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants