Skip to content

Commit

Permalink
Issue #10542: Update inputs for PatternVariableNameCheckTest
Browse files Browse the repository at this point in the history
  • Loading branch information
shashwatj07 authored and romani committed Aug 4, 2021
1 parent a636a80 commit 8ba689e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ public void testDefault() throws Exception {
final String pattern = "^[a-z][a-zA-Z0-9]*$";

final String[] expected = {
"15:39: " + getCheckMessage(MSG_INVALID_PATTERN, "OTHER", pattern),
"25:34: " + getCheckMessage(MSG_INVALID_PATTERN, "Count", pattern),
"40:36: " + getCheckMessage(MSG_INVALID_PATTERN, "S", pattern),
"41:42: " + getCheckMessage(MSG_INVALID_PATTERN, "STRING", pattern),
"44:34: " + getCheckMessage(MSG_INVALID_PATTERN, "STRING", pattern),
"45:43: " + getCheckMessage(MSG_INVALID_PATTERN, "STRING", pattern),
"57:37: " + getCheckMessage(MSG_INVALID_PATTERN, "INTEGER", pattern),
"63:43: " + getCheckMessage(MSG_INVALID_PATTERN, "Thing1", pattern),
"67:41: " + getCheckMessage(MSG_INVALID_PATTERN, "Thing2", pattern),
"18:39: " + getCheckMessage(MSG_INVALID_PATTERN, "OTHER", pattern),
"28:34: " + getCheckMessage(MSG_INVALID_PATTERN, "Count", pattern),
"43:36: " + getCheckMessage(MSG_INVALID_PATTERN, "S", pattern),
"44:42: " + getCheckMessage(MSG_INVALID_PATTERN, "STRING", pattern),
"47:34: " + getCheckMessage(MSG_INVALID_PATTERN, "STRING", pattern),
"48:43: " + getCheckMessage(MSG_INVALID_PATTERN, "STRING", pattern),
"60:37: " + getCheckMessage(MSG_INVALID_PATTERN, "INTEGER", pattern),
"66:43: " + getCheckMessage(MSG_INVALID_PATTERN, "Thing1", pattern),
"70:41: " + getCheckMessage(MSG_INVALID_PATTERN, "Thing2", pattern),
};
verify(checkConfig,
getNonCompilablePath(
Expand All @@ -78,24 +78,24 @@ public void testPatternVariableNameNoSingleChar() throws Exception {
final String pattern = "^[a-z][a-zA-Z0-9]+$";

final String[] expected = {
"15:39: " + getCheckMessage(MSG_INVALID_PATTERN, "OTHER", pattern),
"20:33: " + getCheckMessage(MSG_INVALID_PATTERN, "s", pattern),
"25:34: " + getCheckMessage(MSG_INVALID_PATTERN, "Count", pattern),
"40:36: " + getCheckMessage(MSG_INVALID_PATTERN, "S", pattern),
"41:42: " + getCheckMessage(MSG_INVALID_PATTERN, "STRING", pattern),
"43:34: " + getCheckMessage(MSG_INVALID_PATTERN, "STRING", pattern),
"44:43: " + getCheckMessage(MSG_INVALID_PATTERN, "STRING", pattern),
"46:57: " + getCheckMessage(MSG_INVALID_PATTERN, "s", pattern),
"53:48: " + getCheckMessage(MSG_INVALID_PATTERN, "a", pattern),
"54:39: " + getCheckMessage(MSG_INVALID_PATTERN, "x", pattern),
"55:43: " + getCheckMessage(MSG_INVALID_PATTERN, "y", pattern),
"57:37: " + getCheckMessage(MSG_INVALID_PATTERN, "INTEGER", pattern),
"62:43: " + getCheckMessage(MSG_INVALID_PATTERN, "Thing1", pattern),
"66:41: " + getCheckMessage(MSG_INVALID_PATTERN, "Thing2", pattern),
"71:38: " + getCheckMessage(MSG_INVALID_PATTERN, "j", pattern),
"72:36: " + getCheckMessage(MSG_INVALID_PATTERN, "j", pattern),
"73:37: " + getCheckMessage(MSG_INVALID_PATTERN, "j", pattern),
"80:41: " + getCheckMessage(MSG_INVALID_PATTERN, "s", pattern),
"18:39: " + getCheckMessage(MSG_INVALID_PATTERN, "OTHER", pattern),
"23:33: " + getCheckMessage(MSG_INVALID_PATTERN, "s", pattern),
"28:34: " + getCheckMessage(MSG_INVALID_PATTERN, "Count", pattern),
"43:36: " + getCheckMessage(MSG_INVALID_PATTERN, "S", pattern),
"44:42: " + getCheckMessage(MSG_INVALID_PATTERN, "STRING", pattern),
"46:34: " + getCheckMessage(MSG_INVALID_PATTERN, "STRING", pattern),
"47:43: " + getCheckMessage(MSG_INVALID_PATTERN, "STRING", pattern),
"49:57: " + getCheckMessage(MSG_INVALID_PATTERN, "s", pattern),
"56:48: " + getCheckMessage(MSG_INVALID_PATTERN, "a", pattern),
"57:39: " + getCheckMessage(MSG_INVALID_PATTERN, "x", pattern),
"58:43: " + getCheckMessage(MSG_INVALID_PATTERN, "y", pattern),
"60:37: " + getCheckMessage(MSG_INVALID_PATTERN, "INTEGER", pattern),
"65:43: " + getCheckMessage(MSG_INVALID_PATTERN, "Thing1", pattern),
"69:41: " + getCheckMessage(MSG_INVALID_PATTERN, "Thing2", pattern),
"74:38: " + getCheckMessage(MSG_INVALID_PATTERN, "j", pattern),
"75:36: " + getCheckMessage(MSG_INVALID_PATTERN, "j", pattern),
"76:37: " + getCheckMessage(MSG_INVALID_PATTERN, "j", pattern),
"83:41: " + getCheckMessage(MSG_INVALID_PATTERN, "s", pattern),
};

verify(checkConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/*
PatternVariableName
format = (default)^[a-z][a-zA-Z0-9]*$
*/

//non-compiled with javac: Compilable with Java14
package com.puppycrawl.tools.checkstyle.checks.naming.patternvariablename;

import java.util.ArrayList;
import java.util.Locale;
/*
* Config:
* tokens = PATTERN_VARIABLE_DEF
* format = "^[a-z][a-zA-Z0-9]+$"
*/

public class InputPatternVariableNameEnhancedInstanceofNoSingleChar {
private Object obj;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/*
PatternVariableName
format = (default)^[a-z][a-zA-Z0-9]*$
*/

//non-compiled with javac: Compilable with Java14
package com.puppycrawl.tools.checkstyle.checks.naming.patternvariablename;

import java.util.ArrayList;
import java.util.Locale;
/*
* Config:
* tokens = PATTERN_VARIABLE_DEF
* format = "^[a-z][a-zA-Z0-9]*$"
*/

public class InputPatternVariableNameEnhancedInstanceofTestDefault {
private Object obj;

Expand Down

0 comments on commit 8ba689e

Please sign in to comment.