diff options
4 files changed, 13 insertions, 9 deletions
diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java index b7f8d6ca224..d7859af4fa7 100644 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java +++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java @@ -156,6 +156,10 @@ public class TestSourceReader { StringBuilder content = new StringBuilder(); for (String line = br.readLine(); line != null; line = br.readLine()) { line = line.replaceFirst("^\\s*", ""); // Replace leading whitespace, preserve trailing + // Trailing whitespace can be removed by editor/clean-up actions. To enforce whitespace + // at end of line, use ${whitspace_eol}, which will be removed, but cause the + // whitespace to the left of it to be preserved. + line = line.replace("${whitespace_eol}", ""); if (line.startsWith("//")) { content.append(line.substring(2)).append('\n'); } else { diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java index db927b6acc6..f3e30a3febf 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TemplateFormatterTest.java @@ -102,7 +102,7 @@ public class TemplateFormatterTest extends BaseUITestCase { //} //for(int var=0; var<max; var++) { - // + // ${whitespace_eol} //} public void testForLoopTemplateDefault() throws Exception { assertFormatterResult(); @@ -113,7 +113,7 @@ public class TemplateFormatterTest extends BaseUITestCase { //} //for(int var=0; var<max; var++) { - // + // ${whitespace_eol} //} public void testForLoopTemplateMixedIndent() throws Exception { setOption(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, DefaultCodeFormatterConstants.MIXED); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentAutoEditStrategyTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentAutoEditStrategyTest.java index 99f5f62dc19..ddca5ea104d 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentAutoEditStrategyTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentAutoEditStrategyTest.java @@ -103,7 +103,7 @@ public class DoxygenCCommentAutoEditStrategyTest extends AbstractAutoEditTest { // /** X // void foo() {} - // /** + // /** ${whitespace_eol} // * X // */ // void foo() {} @@ -126,7 +126,7 @@ public class DoxygenCCommentAutoEditStrategyTest extends AbstractAutoEditTest { // /** X // int foo_bar() {} - // /** + // /** ${whitespace_eol} // * X // * @return // */ @@ -506,7 +506,7 @@ public class DoxygenCCommentAutoEditStrategyTest extends AbstractAutoEditTest { // /** X // int foo_bar(); - // /** + // /** ${whitespace_eol} // * X // * @return // */ diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentSingleAutoEditStrategyTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentSingleAutoEditStrategyTest.java index 7e0188500b2..fb280c6d0ae 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentSingleAutoEditStrategyTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/doctools/doxygen/DoxygenCCommentSingleAutoEditStrategyTest.java @@ -102,7 +102,7 @@ public class DoxygenCCommentSingleAutoEditStrategyTest extends AbstractAutoEditT // /// X // void foo() {} - // /// + // /// ${whitespace_eol} // /// X // void foo() {} public void testAutoDocCommentContent2() throws CoreException { @@ -192,7 +192,7 @@ public class DoxygenCCommentSingleAutoEditStrategyTest extends AbstractAutoEditT // C* bar_baz(A a, B b, int c) {} // class A {}; class B {}; - // /// + // /// ${whitespace_eol} // /// X@param a // /// @param b // /// @param c @@ -271,7 +271,7 @@ public class DoxygenCCommentSingleAutoEditStrategyTest extends AbstractAutoEditT // {} // void foo_bar(int x) - // /// + // /// ${whitespace_eol} // /// X@param x // {} public void testAutoDocCommentContent9b() throws CoreException { @@ -282,7 +282,7 @@ public class DoxygenCCommentSingleAutoEditStrategyTest extends AbstractAutoEditT // {} // void foo_bar(int x) - // /// + // /// ${whitespace_eol} // /// X@param x // {} public void testAutoDocCommentContent9c() throws CoreException { |