File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
core/src/test/java/com/google/googlejavaformat/java Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -1488,4 +1488,46 @@ public void missingSummaryFragment() {
14881488 };
14891489 doFormatTest (input , expected );
14901490 }
1491+
1492+ @ Test
1493+ public void simpleMarkdown () {
1494+ String [] input = {
1495+ "package com.example;" ,
1496+ "" ,
1497+ "/// # Heading" ,
1498+ "///" ,
1499+ "/// A very long line of text, long enough that it will need to be wrapped to fit within the"
1500+ + " maximum line length." ,
1501+ "class Test {" ,
1502+ " /// Another very long line of text, also long enough that it will need to be wrapped to"
1503+ + " fit within the maximum line length." ,
1504+ " /// @param <T> a generic type" ,
1505+ " <T> T method() {" ,
1506+ " return null;" ,
1507+ " }" ,
1508+ "}" ,
1509+ };
1510+ // TODO(emcmanus): Fix the formatter so it doesn't produce this nonsense:
1511+ // - wrapped lines should start with /// not //
1512+ // - blank line before @param
1513+ String [] expected = {
1514+ "package com.example;" ,
1515+ "" ,
1516+ "/// # Heading" ,
1517+ "///" ,
1518+ "/// A very long line of text, long enough that it will need to be wrapped to fit within the"
1519+ + " maximum" ,
1520+ "// line length." ,
1521+ "class Test {" ,
1522+ " /// Another very long line of text, also long enough that it will need to be wrapped to"
1523+ + " fit within" ,
1524+ " // the maximum line length." ,
1525+ " /// @param <T> a generic type" ,
1526+ " <T> T method() {" ,
1527+ " return null;" ,
1528+ " }" ,
1529+ "}" ,
1530+ };
1531+ doFormatTest (input , expected );
1532+ }
14911533}
You can’t perform that action at this time.
0 commit comments