Added Ut to show that method call line wrapping now is works correct. #116
This commit is contained in:
parent
0b8af67b3a
commit
328e27a1c7
|
|
@ -60,6 +60,16 @@ public class IndentationCheckTest extends BaseCheckTestSupport
|
|||
verify(checkConfig, getPath("indentation/InputAndroidStyle.java"), expected);
|
||||
}
|
||||
|
||||
public void testMethodCallLineWrap() throws Exception
|
||||
{
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
|
||||
final String[] expected = {
|
||||
"36: 'method call' child have incorrect indentation level 18, expected level should be 20.",
|
||||
"37: 'method call rparen' have incorrect indentation level 14, expected level should be 16.",
|
||||
};
|
||||
verify(checkConfig, getPath("indentation/InputMethodCallLineWrap.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAnonClassesFromGuava() throws Exception
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package com.puppycrawl.tools.checkstyle.indentation;
|
||||
|
||||
public class InputMethodCallLineWrap {
|
||||
|
||||
void foo() {
|
||||
new String()
|
||||
.substring(
|
||||
0, 100
|
||||
)
|
||||
.substring(
|
||||
0, 50
|
||||
);
|
||||
}
|
||||
|
||||
class InnerFoo {
|
||||
|
||||
void foo() {
|
||||
new String()
|
||||
.substring(
|
||||
0, 100
|
||||
)
|
||||
.substring(
|
||||
0, 50
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
InnerFoo anon = new InnerFoo() {
|
||||
|
||||
void foo() {
|
||||
new String()
|
||||
.substring(
|
||||
0, 100
|
||||
)
|
||||
.substring(
|
||||
0, 50 //incorrect
|
||||
); //incorrect
|
||||
}
|
||||
};
|
||||
}
|
||||
Loading…
Reference in New Issue