'Blank lines' tests are moved to the dedicated test class

This commit is contained in:
Denis Zhdanov
2010-05-04 14:44:18 +04:00
parent 8fa000c61a
commit 4b2f3e444a

View File

@@ -45,4 +45,86 @@ public class JavaFormatterBlankLinesTest extends AbstractJavaFormatterTest {
"}");
}
public void testBlankLinesAroundClassMethods() {
// Inspired by IDEA-19408
getSettings().BLANK_LINES_AROUND_METHOD = 3;
doTextTest(
"class Test {\n" +
" public boolean flag1() {\n" +
" return false;\n" +
" }public boolean flag2() {\n" +
" return false;\n" +
" }public boolean flag3() {\n" +
" return false;\n" +
" }public boolean flag4() {\n" +
" return false;\n" +
" }\n" +
"}",
"class Test {\n" +
" public boolean flag1() {\n" +
" return false;\n" +
" }\n" +
"\n" +
"\n" +
"\n" +
" public boolean flag2() {\n" +
" return false;\n" +
" }\n" +
"\n" +
"\n" +
"\n" +
" public boolean flag3() {\n" +
" return false;\n" +
" }\n" +
"\n" +
"\n" +
"\n" +
" public boolean flag4() {\n" +
" return false;\n" +
" }\n" +
"}"
);
}
public void testBlankLinesAroundEnumMethods() {
// Inspired by IDEA-19408
getSettings().BLANK_LINES_AROUND_METHOD = 2;
doTextTest(
"public enum Wrapping {\n" +
" WRAPPING {public boolean flag1() {\n" +
" return false;\n" +
" }public boolean flag2() {\n" +
" return false;\n" +
" }public boolean flag3() {\n" +
" return false;\n" +
" }public boolean flag4() {\n" +
" return false;\n" +
" }}\n" +
"}",
"public enum Wrapping {\n" +
" WRAPPING {\n" +
" public boolean flag1() {\n" +
" return false;\n" +
" }\n" +
"\n" +
"\n" +
" public boolean flag2() {\n" +
" return false;\n" +
" }\n" +
"\n" +
"\n" +
" public boolean flag3() {\n" +
" return false;\n" +
" }\n" +
"\n" +
"\n" +
" public boolean flag4() {\n" +
" return false;\n" +
" }\n" +
" }\n" +
"}"
);
}
}