Issue #13321: Kill mutation for OrderedPropertiesCheck-2#13374
Issue #13321: Kill mutation for OrderedPropertiesCheck-2#13374romani merged 1 commit intocheckstyle:masterfrom
Conversation
|
GIthub, generate report |
|
Github, generate report |
|
@Kevin222004 No rationale? |
| private static Pattern getKeyPattern(String keyName) { | ||
| final String keyPatternString = "^" + SPACE_PATTERN.matcher(keyName) | ||
| .replaceAll(Matcher.quoteReplacement("\\\\ ")) + "[\\s:=].*"; | ||
| .replaceAll("") + "[\\s:=].*"; |
There was a problem hiding this comment.
@Kevin222004 You can have properties with space in them, eg:
foo\ bar:hooThe whitespace is escaped. You can see https://stackoverflow.com/q/2108103/15412365
There was a problem hiding this comment.
@Kevin222004 SPACE_PATTERN.matcher(keyName).replaceAll(Matcher.quoteReplacement("\\\\ ")), whitespace is being quoted to get the key pattern. Whitespace is escaped using \ in key so double quoting is required to get the pattern.
Please add print statements to see the difference between patterns, which will highlight what is needed to be changed. Please do ask if something is unclear.
|
Test added |
|
@romani please re-run failing ci |
|
Circleci was relaunched |
romani
left a comment
There was a problem hiding this comment.
Ok to merge
Covered by new test
Issue #13321: Kill mutation for OrderedPropertiesCheck-2
Check :-
https://checkstyle.org/checks/misc/orderedproperties.html#OrderedProperties
Mutation :-
checkstyle/config/pitest-suppressions/pitest-misc-suppressions.xml
Lines 39 to 55 in 20a52f7
Explaination
Test added
Diff Regression config: https://gist.githubusercontent.com/Kevin222004/c3213434af8523d918594b88ce5554f7/raw/3565cfcd975e228af515bb34ce22c83afce0a7c7/opc.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/9600f179b602d4c971bdb0a050099005/raw/360a95ed7bb60d7a0956e531199d484c4d6f6617/test-projects.properties
Report label: Regression-2