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 56463 Details for
Bug 99738
[formatting] each format shifts code inside <pre> one space to the right
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression tests
patch_99738_tests.txt (text/plain), 5.21 KB, created by
Olivier Thomann
on 2007-01-05 11:04:44 EST
(
hide
)
Description:
Regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2007-01-05 11:04:44 EST
Size:
5.21 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/formatter/comment/JavaDocTestCase.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/comment/JavaDocTestCase.java,v >retrieving revision 1.5 >diff -u -r1.5 JavaDocTestCase.java >--- src/org/eclipse/jdt/core/tests/formatter/comment/JavaDocTestCase.java 29 Mar 2006 04:03:08 -0000 1.5 >+++ src/org/eclipse/jdt/core/tests/formatter/comment/JavaDocTestCase.java 5 Jan 2007 15:58:21 -0000 >@@ -20,6 +20,10 @@ > import org.eclipse.jdt.internal.formatter.comment.MultiCommentLine; > > public class JavaDocTestCase extends CommentTestCase { >+ >+ static { >+// TESTS_NAMES = new String[] { "testNoExtraNewlineWithPre1" } ; >+ } > > protected static final String INFIX= MultiCommentLine.MULTI_COMMENT_CONTENT_PREFIX; > >@@ -90,7 +94,15 @@ > String postfix= DELIMITER + INFIX + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$ > String input= prefix + "while (i != 0) i--;" + postfix; //$NON-NLS-1$ > String expected= prefix + "while (i != 0)" + DELIMITER + INFIX + "\ti--;" + postfix; //$NON-NLS-1$//$NON-NLS-2$ >- assertEquals(expected, testFormat(input)); >+ String result= testFormat(input); >+ assertEquals(expected, result); >+ >+ result= testFormat(result); >+ result= testFormat(result); >+ result= testFormat(result); >+ result= testFormat(result); >+ >+ assertEquals(expected, result); > } > > /** >@@ -102,13 +114,29 @@ > String postfix= DELIMITER + INFIX + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$ > String input= prefix + "while (i != 0) { i--; }" + postfix; //$NON-NLS-1$ > String expected= prefix + "while (i != 0) {" + DELIMITER + INFIX + "\ti--;" + DELIMITER + INFIX + "}" + postfix; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >- assertEquals(expected, testFormat(input)); >+ String result= testFormat(input); >+ assertEquals(expected, result); >+ >+ result= testFormat(result); >+ result= testFormat(result); >+ result= testFormat(result); >+ result= testFormat(result); >+ >+ assertEquals(expected, result); > } > > public void testMultiLineCommentCodeSnippet3() { > String input= PREFIX + DELIMITER + "<pre>" + DELIMITER + "while (i != 0)" + DELIMITER + "i--;" + DELIMITER + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ > String expected= PREFIX + DELIMITER + INFIX + "<pre>" + DELIMITER + INFIX + "while (i != 0)" + DELIMITER + INFIX + "\ti--;" + DELIMITER + INFIX + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ >- assertEquals(expected, testFormat(input)); >+ String result= testFormat(input); >+ assertEquals(expected, result); >+ >+ result= testFormat(result); >+ result= testFormat(result); >+ result= testFormat(result); >+ result= testFormat(result); >+ >+ assertEquals(expected, result); > } > > public void testMultiLineCommentCodeSnippetHtmlEntities1() { >@@ -116,7 +144,15 @@ > String postfix= DELIMITER + INFIX + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$ > String input= prefix + "System.out.println(\"test\");" + postfix; //$NON-NLS-1$ > String expected= prefix + "System.out.println("test");" + postfix; //$NON-NLS-1$ >- assertEquals(expected, testFormat(input)); >+ String result= testFormat(input); >+ assertEquals(expected, result); >+ >+ result= testFormat(result); >+ result= testFormat(result); >+ result= testFormat(result); >+ result= testFormat(result); >+ >+ assertEquals(expected, result); > } > > public void testMultiLineCommentIndentTabs1() { >@@ -453,9 +489,31 @@ > result= testFormat(result); > result= testFormat(result); > >- // XXX: workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=99738 >- String WORKAROUND_BUG_99738= " "; //$NON-NLS-1$ >- expected= PREFIX + DELIMITER + INFIX + "<pre>" + DELIMITER + INFIX + WORKAROUND_BUG_99738 + "wrap here" + DELIMITER + INFIX + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$; //$NON-NLS-2$; //$NON-NLS-3$; >+ expected= PREFIX + DELIMITER + INFIX + "<pre>" + DELIMITER + INFIX + "wrap here" + DELIMITER + INFIX + "</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$; //$NON-NLS-2$; //$NON-NLS-3$; >+ assertEquals(expected, result); >+ } >+ >+ /** >+ * [formatting] Javadoc formatting: extra newline with [pre] >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52921 >+ * <p> >+ * This test only formats once. >+ * </p> >+ */ >+ public void testNoExtraNewlineWithPre2() { >+ setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, DefaultCodeFormatterConstants.FALSE); >+ String input= PREFIX + DELIMITER + INFIX + "<pre>wrap here</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$ >+ String expected= PREFIX + DELIMITER + INFIX + "<pre>wrap here</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$ >+ String result= testFormat(input); >+ assertEquals(expected, result); >+ >+ // now re-format several times >+ result= testFormat(result); >+ result= testFormat(result); >+ result= testFormat(result); >+ result= testFormat(result); >+ >+ expected= PREFIX + DELIMITER + INFIX + "<pre>wrap here</pre>" + DELIMITER + POSTFIX; //$NON-NLS-1$ > assertEquals(expected, result); > } >
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 99738
:
56462
| 56463