Preserving leading and trailing asterisks in javadoc while formatting (IDEA-138799)

This commit is contained in:
Yaroslav Lepenkin
2015-04-16 20:30:04 +03:00
parent a97b76faea
commit 35639e517a
4 changed files with 197 additions and 90 deletions
@@ -56,6 +56,61 @@ public class JavadocFormatterTest extends AbstractJavaFormatterTest {
);
}
public void test_do_wrap_on_asterisks() {
doTextTest(
"/***********\n" +
" *\n" +
" *********************/\n" +
"\n" +
"\n" +
" public class Test {\n" +
"}\n",
"/***********\n" +
" *\n" +
" *********************/\n" +
"\n" +
"\n" +
"public class Test {\n" +
"}\n"
);
}
public void test_wrap_after_asterisks() {
doTextTest(
"/******* hollla la\n" +
" * I am javadoc comment\n" +
" * heey ***********/\n" +
" class T { }\n",
"/*******\n" +
" * hollla la\n" +
" * I am javadoc comment\n" +
" * heey\n" +
" ***********/\n" +
"class T {\n" +
"}\n"
);
}
public void test_strange_comment() {
doTextTest(
"/******F*****/\n" +
"public class T {\n" +
"}",
"/******\n" +
" * F\n" +
" *****/\n" +
"public class T {\n" +
"}"
);
}
public void test_incomplete_javadoc() {
doTextTest(
"/**\n",
"/**\n"
);
}
public void testEA49739() throws Exception {
getSettings().WRAP_LONG_LINES = true;
getSettings().RIGHT_MARGIN = 35;