Skip to content

Commit

Permalink
Issue checkstyle#10544: Update inputs for RecordTypeParameterNameChec…
Browse files Browse the repository at this point in the history
…kTest
  • Loading branch information
shashwatj07 committed Aug 4, 2021
1 parent f1ec7b6 commit f2059af
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
Expand Up @@ -53,9 +53,9 @@ public void testRecordDefault()
final String pattern = "^[A-Z]$";

final String[] expected = {
"13:44: " + getCheckMessage(MSG_INVALID_PATTERN, "t", pattern),
"20:15: " + getCheckMessage(MSG_INVALID_PATTERN, "foo", pattern),
"35:25: " + getCheckMessage(MSG_INVALID_PATTERN, "foo", pattern),
"16:44: " + getCheckMessage(MSG_INVALID_PATTERN, "t", pattern),
"23:15: " + getCheckMessage(MSG_INVALID_PATTERN, "foo", pattern),
"38:25: " + getCheckMessage(MSG_INVALID_PATTERN, "foo", pattern),
};
verify(checkConfig,
getNonCompilablePath("InputRecordTypeParameterName.java"), expected);
Expand All @@ -71,9 +71,9 @@ public void testClassFooName()
final String pattern = "^foo$";

final String[] expected = {
"13:47: " + getCheckMessage(MSG_INVALID_PATTERN, "T", pattern),
"20:15: " + getCheckMessage(MSG_INVALID_PATTERN, "T", pattern),
"41:19: " + getCheckMessage(MSG_INVALID_PATTERN, "T", pattern),
"16:47: " + getCheckMessage(MSG_INVALID_PATTERN, "T", pattern),
"23:15: " + getCheckMessage(MSG_INVALID_PATTERN, "T", pattern),
"44:19: " + getCheckMessage(MSG_INVALID_PATTERN, "T", pattern),
};
verify(checkConfig,
getNonCompilablePath("InputRecordTypeParameterNameFoo.java"), expected);
Expand Down
@@ -1,3 +1,10 @@
/*
RecordTypeParameterName
format = (default)^[A-Z]$
*/

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

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

import org.w3c.dom.Node;

/* Config:
* pattern = "^[A-Z]$"
*
*/
public record InputRecordTypeParameterName<t>(Integer x, String str) { // violation
public <TT> void foo() { }

Expand Down
@@ -1,3 +1,10 @@
/*
RecordTypeParameterName
format = ^foo$
*/

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

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

import org.w3c.dom.Node;

/* Config:
* pattern = "^foo$"
*
*/
public record InputRecordTypeParameterNameFoo<T>(Integer x, String str) { // violation
public <TT> void foo() { }

Expand Down

0 comments on commit f2059af

Please sign in to comment.