Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 229444 Details for
Bug 405038
[formatter] infix expression formatting broken without spaces before/after binary operator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Regression tests
patch_405038_tests.txt (text/plain), 4.82 KB, created by
Olivier Thomann
on 2013-04-08 09:52:20 EDT
(
hide
)
Description:
Regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2013-04-08 09:52:20 EDT
Size:
4.82 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java >index 1ccb9f0..60ccc18 100644 >--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java >+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java >@@ -64,6 +64,13 @@ > static { > // TESTS_NUMBERS = new int[] { 783 }; > // TESTS_RANGE = new int[] { 734, -1 }; >+// TESTS_NAMES = new String[] { >+// "testBug405038", >+// "testBug405038_2", >+// "testBug405038_3", >+// "testBug405038_4", >+// "testBug405038_5" >+// }; > } > public static Test suite() { > return buildModelTestSuite(FormatterRegressionTests.class); >@@ -12938,4 +12945,104 @@ > "}\n" > ); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=405038 >+//To verify that the whitespace options for resources in try statement work correctly >+public void testBug405038() throws Exception { >+ this.formatterPrefs = null; >+ this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR, JavaCore.DO_NOT_INSERT); >+ this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, JavaCore.DO_NOT_INSERT); >+ String source = >+ "public class FormatterError {\n" + >+ " int foo(int a, int b, int c) {\n" + >+ " return a + b + ++c;\n" + >+ " }\n" + >+ "}\n"; >+ formatSource(source, >+ "public class FormatterError {\n" + >+ " int foo(int a, int b, int c) {\n" + >+ " return a+b+ ++c;\n" + >+ " }\n" + >+ "}\n" >+ ); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=405038 >+//To verify that the whitespace options for resources in try statement work correctly >+public void testBug405038_2() throws Exception { >+ this.formatterPrefs = null; >+ this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR, JavaCore.DO_NOT_INSERT); >+ this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, JavaCore.DO_NOT_INSERT); >+ String source = >+ "public class FormatterError {\n" + >+ " int foo(int a, int b, int c) {\n" + >+ " return a + ++b + c;\n" + >+ " }\n" + >+ "}\n"; >+ formatSource(source, >+ "public class FormatterError {\n" + >+ " int foo(int a, int b, int c) {\n" + >+ " return a+ ++b+c;\n" + >+ " }\n" + >+ "}\n" >+ ); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=405038 >+//To verify that the whitespace options for resources in try statement work correctly >+public void testBug405038_3() throws Exception { >+ this.formatterPrefs = null; >+ this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR, JavaCore.DO_NOT_INSERT); >+ this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, JavaCore.DO_NOT_INSERT); >+ String source = >+ "public class FormatterError {\n" + >+ " int foo(int a, int b, int c) {\n" + >+ " return a - --b + c;\n" + >+ " }\n" + >+ "}\n"; >+ formatSource(source, >+ "public class FormatterError {\n" + >+ " int foo(int a, int b, int c) {\n" + >+ " return a- --b+c;\n" + >+ " }\n" + >+ "}\n" >+ ); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=405038 >+//To verify that the whitespace options for resources in try statement work correctly >+public void testBug405038_4() throws Exception { >+ this.formatterPrefs = null; >+ this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR, JavaCore.DO_NOT_INSERT); >+ this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, JavaCore.DO_NOT_INSERT); >+ String source = >+ "public class FormatterError {\n" + >+ " int foo(int a, int b, int c) {\n" + >+ " return a - -b + c;\n" + >+ " }\n" + >+ "}\n"; >+ formatSource(source, >+ "public class FormatterError {\n" + >+ " int foo(int a, int b, int c) {\n" + >+ " return a- -b+c;\n" + >+ " }\n" + >+ "}\n" >+ ); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=405038 >+//To verify that the whitespace options for resources in try statement work correctly >+public void testBug405038_5() throws Exception { >+ this.formatterPrefs = null; >+ this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR, JavaCore.DO_NOT_INSERT); >+ this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, JavaCore.DO_NOT_INSERT); >+ String source = >+ "public class FormatterError {\n" + >+ " int foo(int a, int b, int c) {\n" + >+ " return a - -b + ++c;\n" + >+ " }\n" + >+ "}\n"; >+ formatSource(source, >+ "public class FormatterError {\n" + >+ " int foo(int a, int b, int c) {\n" + >+ " return a- -b+ ++c;\n" + >+ " }\n" + >+ "}\n" >+ ); >+} > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 405038
:
229443
| 229444