Skip to content

Commit

Permalink
Issue #10543: Update inputs for RecordComponentNameCheckTest
Browse files Browse the repository at this point in the history
  • Loading branch information
shashwatj07 authored and romani committed Aug 4, 2021
1 parent 1ecc59d commit 8dd7a39
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
Expand Up @@ -53,10 +53,10 @@ public void testRecordDefault()
final String pattern = "^[a-z][a-zA-Z0-9]*$";

final String[] expected = {
"14:34: " + getCheckMessage(MSG_INVALID_PATTERN, "value_123", pattern),
"15:15: " + getCheckMessage(MSG_INVALID_PATTERN, "Values", pattern),
"18:35: " + getCheckMessage(MSG_INVALID_PATTERN, "_value123", pattern),
"19:9: " + getCheckMessage(MSG_INVALID_PATTERN, "$age", pattern),
"19:34: " + getCheckMessage(MSG_INVALID_PATTERN, "value_123", pattern),
"20:15: " + getCheckMessage(MSG_INVALID_PATTERN, "Values", pattern),
"23:35: " + getCheckMessage(MSG_INVALID_PATTERN, "_value123", pattern),
"24:9: " + getCheckMessage(MSG_INVALID_PATTERN, "$age", pattern),
};
verify(checkConfig,
getNonCompilablePath("InputRecordComponentNameDefault.java"), expected);
Expand All @@ -72,10 +72,10 @@ public void testClassFooName()
final String pattern = "^[a-z0-9]+$";

final String[] expected = {
"15:36: " + getCheckMessage(MSG_INVALID_PATTERN, "value_123", pattern),
"16:15: " + getCheckMessage(MSG_INVALID_PATTERN, "Values", pattern),
"19:37: " + getCheckMessage(MSG_INVALID_PATTERN, "V", pattern),
"20:9: " + getCheckMessage(MSG_INVALID_PATTERN, "$age", pattern),
"19:36: " + getCheckMessage(MSG_INVALID_PATTERN, "value_123", pattern),
"20:15: " + getCheckMessage(MSG_INVALID_PATTERN, "Values", pattern),
"23:37: " + getCheckMessage(MSG_INVALID_PATTERN, "V", pattern),
"24:9: " + getCheckMessage(MSG_INVALID_PATTERN, "$age", pattern),
};
verify(checkConfig,
getNonCompilablePath("InputRecordComponentNameLowercase.java"), expected);
Expand Down
@@ -1,3 +1,10 @@
/*
RecordComponentName
format = (default)^[a-z][a-zA-Z0-9]*$
*/

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

Expand All @@ -6,8 +13,6 @@

import org.w3c.dom.Node;

/* Config: default
*/
public record InputRecordComponentNameDefault(int x, String str, Double myValue1, int i1) { // ok
}

Expand Down
@@ -1,3 +1,10 @@
/*
RecordComponentName
format = ^[a-z\\d]+$
*/

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

Expand All @@ -6,9 +13,6 @@

import org.w3c.dom.Node;

/* Config:
* pattern = "^[a-z\\d]+$"
*/
public record InputRecordComponentNameLowercase(Integer x, String str, Double val123) { // ok
}

Expand Down

0 comments on commit 8dd7a39

Please sign in to comment.