Add test cases for one character lambda parameters and for loop variables
This commit is contained in:
@@ -47,6 +47,32 @@
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>One character lambda Parameters should be allowed by default</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
||||
public class Bar {
|
||||
|
||||
public void foo() {
|
||||
Consumer<String> i = (s) -> {
|
||||
|
||||
};
|
||||
|
||||
Consumer<String> k = (String s) -> {
|
||||
|
||||
};
|
||||
|
||||
Consumer<String> l = (final String s) -> {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>Test method param pattern</description>
|
||||
<rule-property name="methodParameterPattern">[A-Z]+</rule-property>
|
||||
|
||||
@@ -118,5 +118,19 @@
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>One character for loop variables should be ok by default</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class LocalVarNamingConvention {
|
||||
public void bar() {
|
||||
for (int i = 0; i < 10; i++) { }
|
||||
|
||||
List<String> data = Arrays.asList("a", "b");
|
||||
for (String s : data) { }
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
</test-data>
|
||||
|
||||
Reference in New Issue
Block a user