Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2010 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2011 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 8-13
Link Here
|
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
10 |
* Brock Janiczak - Contribution for bug 150741 |
10 |
* Brock Janiczak - Contribution for bug 150741 |
|
|
11 |
* Ray V. (voidstar@gmail.com) - Contribution for bug 282988 |
11 |
*******************************************************************************/ |
12 |
*******************************************************************************/ |
12 |
package org.eclipse.jdt.core.tests.formatter; |
13 |
package org.eclipse.jdt.core.tests.formatter; |
13 |
|
14 |
|
Lines 61-68
Link Here
|
61 |
Map formatterOptions; |
62 |
Map formatterOptions; |
62 |
|
63 |
|
63 |
static { |
64 |
static { |
64 |
// TESTS_NUMBERS = new int[] { 730 }; |
65 |
// TESTS_NUMBERS = new int[] { 736 }; |
65 |
// TESTS_RANGE = new int[] { 730, -1 }; |
66 |
TESTS_RANGE = new int[] { 734, -1 }; |
66 |
} |
67 |
} |
67 |
public static Test suite() { |
68 |
public static Test suite() { |
68 |
return buildModelTestSuite(FormatterRegressionTests.class); |
69 |
return buildModelTestSuite(FormatterRegressionTests.class); |
Lines 10981-10984
Link Here
|
10981 |
"}" |
10982 |
"}" |
10982 |
); |
10983 |
); |
10983 |
} |
10984 |
} |
|
|
10985 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=282988 |
10986 |
public void test734() { |
10987 |
this.formatterPrefs = null; |
10988 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.TRUE); |
10989 |
String source = |
10990 |
"package p;\n" + |
10991 |
"\n" + |
10992 |
"public class Comment {\n" + |
10993 |
" public static void main(String[] args) {\n" + |
10994 |
" // internal indentation\n" + |
10995 |
" int i = 1; // tabs\n" + |
10996 |
" int j = 2; // spaces\n" + |
10997 |
" int k = 3; // mixed tabs and spaces\n" + |
10998 |
" System.out.print(i); /* does not affect block comments */\n" + |
10999 |
" }\n" + |
11000 |
"}\n"; |
11001 |
formatSource(source, |
11002 |
"package p;\n" + |
11003 |
"\n" + |
11004 |
"public class Comment {\n" + |
11005 |
" public static void main(String[] args) {\n" + |
11006 |
" // internal indentation\n" + |
11007 |
" int i = 1; // tabs\n" + |
11008 |
" int j = 2; // spaces\n" + |
11009 |
" int k = 3; // mixed tabs and spaces\n" + |
11010 |
" System.out.print(i); /* does not affect block comments */\n" + |
11011 |
" }\n" + |
11012 |
"}\n" |
11013 |
); |
11014 |
} |
11015 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=282988 |
11016 |
public void test735() { |
11017 |
this.formatterPrefs = null; |
11018 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.FALSE); |
11019 |
String source = |
11020 |
"package p;\n" + |
11021 |
"\n" + |
11022 |
"public class Comment {\n" + |
11023 |
" public static void main(String[] args) {\n" + |
11024 |
" // internal indentation\n" + |
11025 |
" int i = 1; // tabs\n" + |
11026 |
" int j = 2; // spaces\n" + |
11027 |
" int k = 3; // mixed tabs and spaces\n" + |
11028 |
" System.out.print(i); /* does not affect block comments */\n" + |
11029 |
" }\n" + |
11030 |
"}\n"; |
11031 |
formatSource(source, |
11032 |
"package p;\n" + |
11033 |
"\n" + |
11034 |
"public class Comment {\n" + |
11035 |
" public static void main(String[] args) {\n" + |
11036 |
" // internal indentation\n" + |
11037 |
" int i = 1; // tabs\n" + |
11038 |
" int j = 2; // spaces\n" + |
11039 |
" int k = 3; // mixed tabs and spaces\n" + |
11040 |
" System.out.print(i); /* does not affect block comments */\n" + |
11041 |
" }\n" + |
11042 |
"}\n" |
11043 |
); |
11044 |
} |
11045 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=282988 |
11046 |
public void test736() { |
11047 |
this.formatterPrefs = null; |
11048 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.TRUE); |
11049 |
String source = |
11050 |
"package p;\n" + |
11051 |
"\n" + |
11052 |
"public class Comment {\n" + |
11053 |
" public static void main(String[] args) {\n" + |
11054 |
" // internal indentation\n" + |
11055 |
" int i = 1;// tabs\n" + |
11056 |
" int j = 2;// spaces\n" + |
11057 |
" int k = 3;// mixed tabs and spaces\n" + |
11058 |
" System.out.print(i); /* does not affect block comments */\n" + |
11059 |
" }\n" + |
11060 |
"}\n"; |
11061 |
formatSource(source, |
11062 |
"package p;\n" + |
11063 |
"\n" + |
11064 |
"public class Comment {\n" + |
11065 |
" public static void main(String[] args) {\n" + |
11066 |
" // internal indentation\n" + |
11067 |
" int i = 1;// tabs\n" + |
11068 |
" int j = 2;// spaces\n" + |
11069 |
" int k = 3;// mixed tabs and spaces\n" + |
11070 |
" System.out.print(i); /* does not affect block comments */\n" + |
11071 |
" }\n" + |
11072 |
"}\n" |
11073 |
); |
11074 |
} |
11075 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=282988 |
11076 |
public void test737() { |
11077 |
this.formatterPrefs = null; |
11078 |
this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT, DefaultCodeFormatterConstants.FALSE); |
11079 |
String source = |
11080 |
"package p;\n" + |
11081 |
"\n" + |
11082 |
"public class Comment {\n" + |
11083 |
" public static void main(String[] args) {\n" + |
11084 |
" // internal indentation\n" + |
11085 |
" int i = 1;// tabs\n" + |
11086 |
" int j = 2;// spaces\n" + |
11087 |
" int k = 3;// mixed tabs and spaces\n" + |
11088 |
" System.out.print(i); /* does not affect block comments */\n" + |
11089 |
" }\n" + |
11090 |
"}\n"; |
11091 |
formatSource(source, |
11092 |
"package p;\n" + |
11093 |
"\n" + |
11094 |
"public class Comment {\n" + |
11095 |
" public static void main(String[] args) {\n" + |
11096 |
" // internal indentation\n" + |
11097 |
" int i = 1;// tabs\n" + |
11098 |
" int j = 2;// spaces\n" + |
11099 |
" int k = 3;// mixed tabs and spaces\n" + |
11100 |
" System.out.print(i); /* does not affect block comments */\n" + |
11101 |
" }\n" + |
11102 |
"}\n" |
11103 |
); |
11104 |
} |
10984 |
} |
11105 |
} |