Lines 7832-7835
Link Here
|
7832 |
expectedFullUnitToString, |
7832 |
expectedFullUnitToString, |
7833 |
expectedCompletionDietUnitToString, testName); |
7833 |
expectedCompletionDietUnitToString, testName); |
7834 |
} |
7834 |
} |
|
|
7835 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=201762 |
7836 |
public void test127() { |
7837 |
String s = |
7838 |
"import org.eclipse.swt.*;\n" + |
7839 |
"import org.eclipse.swt.events.*;\n" + |
7840 |
"import org.eclipse.swt.widgets.*;\n" + |
7841 |
"\n" + |
7842 |
"public class Try {\n" + |
7843 |
"\n" + |
7844 |
" void main(Shell shell) {\n" + |
7845 |
"\n" + |
7846 |
" final Label label= new Label(shell, SWT.WRAP);\n" + |
7847 |
" label.addPaintListener(new PaintListener() {\n" + |
7848 |
" public void paintControl(PaintEvent e) {\n" + |
7849 |
" e.gc.setLineCap(SWT.CAP_); // content assist after CAP_\n" + |
7850 |
" }\n" + |
7851 |
" });\n" + |
7852 |
"\n" + |
7853 |
" shell.addControlListener(new ControlAdapter() { });\n" + |
7854 |
"\n" + |
7855 |
" while (!shell.isDisposed()) { }\n" + |
7856 |
" }\n" + |
7857 |
"}\n" + |
7858 |
"\n"; |
7859 |
|
7860 |
String expectedDietUnitToString = |
7861 |
"import org.eclipse.swt.*;\n" + |
7862 |
"import org.eclipse.swt.events.*;\n" + |
7863 |
"import org.eclipse.swt.widgets.*;\n" + |
7864 |
"public class Try {\n" + |
7865 |
" public Try() {\n" + |
7866 |
" }\n" + |
7867 |
" void main(Shell shell) {\n" + |
7868 |
" }\n" + |
7869 |
"}\n"; |
7870 |
|
7871 |
String expectedDietPlusBodyUnitToString = |
7872 |
"import org.eclipse.swt.*;\n" + |
7873 |
"import org.eclipse.swt.events.*;\n" + |
7874 |
"import org.eclipse.swt.widgets.*;\n" + |
7875 |
"public class Try {\n" + |
7876 |
" public Try() {\n" + |
7877 |
" super();\n" + |
7878 |
" }\n" + |
7879 |
" void main(Shell shell) {\n" + |
7880 |
" final Label label = new Label(shell, SWT.WRAP);\n" + |
7881 |
" label.addPaintListener(new PaintListener() {\n" + |
7882 |
" public void paintControl(PaintEvent e) {\n" + |
7883 |
" e.gc.setLineCap(SWT.CAP_);\n" + |
7884 |
" }\n" + |
7885 |
"});\n" + |
7886 |
" shell.addControlListener(new ControlAdapter() {\n" + |
7887 |
"});\n" + |
7888 |
" while ((! shell.isDisposed())) {\n" + |
7889 |
" }\n" + |
7890 |
" }\n" + |
7891 |
"}\n"; |
7892 |
|
7893 |
String expectedDietPlusBodyPlusStatementsRecoveryUnitToString = |
7894 |
"import org.eclipse.swt.*;\n" + |
7895 |
"import org.eclipse.swt.events.*;\n" + |
7896 |
"import org.eclipse.swt.widgets.*;\n" + |
7897 |
"public class Try {\n" + |
7898 |
" public Try() {\n" + |
7899 |
" super();\n" + |
7900 |
" }\n" + |
7901 |
" void main(Shell shell) {\n" + |
7902 |
" final Label label = new Label(shell, SWT.WRAP);\n" + |
7903 |
" label.addPaintListener(new PaintListener() {\n" + |
7904 |
" public void paintControl(PaintEvent e) {\n" + |
7905 |
" e.gc.setLineCap(SWT.CAP_);\n" + |
7906 |
" }\n" + |
7907 |
"});\n" + |
7908 |
" shell.addControlListener(new ControlAdapter() {\n" + |
7909 |
"});\n" + |
7910 |
" while ((! shell.isDisposed())) {\n" + |
7911 |
" }\n" + |
7912 |
" }\n" + |
7913 |
"}\n"; |
7914 |
|
7915 |
String expectedFullUnitToString = |
7916 |
"import org.eclipse.swt.*;\n" + |
7917 |
"import org.eclipse.swt.events.*;\n" + |
7918 |
"import org.eclipse.swt.widgets.*;\n" + |
7919 |
"public class Try {\n" + |
7920 |
" public Try() {\n" + |
7921 |
" super();\n" + |
7922 |
" }\n" + |
7923 |
" void main(Shell shell) {\n" + |
7924 |
" final Label label = new Label(shell, SWT.WRAP);\n" + |
7925 |
" label.addPaintListener(new PaintListener() {\n" + |
7926 |
" public void paintControl(PaintEvent e) {\n" + |
7927 |
" e.gc.setLineCap(SWT.CAP_);\n" + |
7928 |
" }\n" + |
7929 |
"});\n" + |
7930 |
" shell.addControlListener(new ControlAdapter() {\n" + |
7931 |
"});\n" + |
7932 |
" while ((! shell.isDisposed())) {\n" + |
7933 |
" }\n" + |
7934 |
" }\n" + |
7935 |
"}\n"; |
7936 |
|
7937 |
String expectedCompletionDietUnitToString = |
7938 |
"import org.eclipse.swt.*;\n" + |
7939 |
"import org.eclipse.swt.events.*;\n" + |
7940 |
"import org.eclipse.swt.widgets.*;\n" + |
7941 |
"public class Try {\n" + |
7942 |
" public Try() {\n" + |
7943 |
" }\n" + |
7944 |
" void main(Shell shell) {\n" + |
7945 |
" }\n" + |
7946 |
"}\n"; |
7947 |
|
7948 |
String testName = "test"; |
7949 |
checkParse( |
7950 |
s.toCharArray(), |
7951 |
expectedDietUnitToString, |
7952 |
expectedDietPlusBodyUnitToString, |
7953 |
expectedDietPlusBodyPlusStatementsRecoveryUnitToString, |
7954 |
expectedFullUnitToString, |
7955 |
expectedCompletionDietUnitToString, testName); |
7956 |
} |
7957 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=201762 |
7958 |
public void test128() { |
7959 |
String s = |
7960 |
"import org.eclipse.swt.*;\n" + |
7961 |
"import org.eclipse.swt.events.*;\n" + |
7962 |
"import org.eclipse.swt.widgets.*;\n" + |
7963 |
"\n" + |
7964 |
"public class Try {\n" + |
7965 |
"\n" + |
7966 |
" void main(Shell shell) {\n" + |
7967 |
"\n" + |
7968 |
" final Label label= new Label(shell, SWT.WRAP);\n" + |
7969 |
" label.addPaintListener(new PaintListener() {\n" + |
7970 |
" public void paintControl(PaintEvent e) {\n" + |
7971 |
" e.gc.setLineCap(SWT.CAP_#); // content assist after CAP_\n" + |
7972 |
" }\n" + |
7973 |
" });\n" + |
7974 |
"\n" + |
7975 |
" shell.addControlListener(new ControlAdapter() { });\n" + |
7976 |
"\n" + |
7977 |
" while (!shell.isDisposed()) { }\n" + |
7978 |
" }\n" + |
7979 |
"}\n" + |
7980 |
"\n"; |
7981 |
|
7982 |
String expectedDietUnitToString = |
7983 |
"import org.eclipse.swt.*;\n" + |
7984 |
"import org.eclipse.swt.events.*;\n" + |
7985 |
"import org.eclipse.swt.widgets.*;\n" + |
7986 |
"public class Try {\n" + |
7987 |
" public Try() {\n" + |
7988 |
" }\n" + |
7989 |
" void main(Shell shell) {\n" + |
7990 |
" }\n" + |
7991 |
"}\n"; |
7992 |
|
7993 |
String expectedDietPlusBodyUnitToString = |
7994 |
"import org.eclipse.swt.*;\n" + |
7995 |
"import org.eclipse.swt.events.*;\n" + |
7996 |
"import org.eclipse.swt.widgets.*;\n" + |
7997 |
"public class Try {\n" + |
7998 |
" public Try() {\n" + |
7999 |
" super();\n" + |
8000 |
" }\n" + |
8001 |
" void main(Shell shell) {\n" + |
8002 |
" }\n" + |
8003 |
"}\n"; |
8004 |
|
8005 |
String expectedDietPlusBodyPlusStatementsRecoveryUnitToString = |
8006 |
"import org.eclipse.swt.*;\n" + |
8007 |
"import org.eclipse.swt.events.*;\n" + |
8008 |
"import org.eclipse.swt.widgets.*;\n" + |
8009 |
"public class Try {\n" + |
8010 |
" public Try() {\n" + |
8011 |
" super();\n" + |
8012 |
" }\n" + |
8013 |
" void main(Shell shell) {\n" + |
8014 |
" final Label label = new Label(shell, SWT.WRAP);\n" + |
8015 |
" label.addPaintListener(new PaintListener() {\n" + |
8016 |
" public void paintControl(PaintEvent e) {\n" + |
8017 |
" e.gc.setLineCap(SWT.CAP_);\n" + |
8018 |
" }\n" + |
8019 |
"});\n" + |
8020 |
" shell.addControlListener(new ControlAdapter() {\n" + |
8021 |
"});\n" + |
8022 |
" while ((! shell.isDisposed())) {\n" + |
8023 |
" }\n" + |
8024 |
" }\n" + |
8025 |
"}\n"; |
8026 |
|
8027 |
String expectedFullUnitToString = |
8028 |
"import org.eclipse.swt.*;\n" + |
8029 |
"import org.eclipse.swt.events.*;\n" + |
8030 |
"import org.eclipse.swt.widgets.*;\n" + |
8031 |
"public class Try {\n" + |
8032 |
" public Try() {\n" + |
8033 |
" }\n" + |
8034 |
" void main(Shell shell) {\n" + |
8035 |
" }\n" + |
8036 |
"}\n"; |
8037 |
|
8038 |
String expectedCompletionDietUnitToString = |
8039 |
"import org.eclipse.swt.*;\n" + |
8040 |
"import org.eclipse.swt.events.*;\n" + |
8041 |
"import org.eclipse.swt.widgets.*;\n" + |
8042 |
"public class Try {\n" + |
8043 |
" public Try() {\n" + |
8044 |
" }\n" + |
8045 |
" void main(Shell shell) {\n" + |
8046 |
" }\n" + |
8047 |
"}\n"; |
8048 |
|
8049 |
String testName = "test"; |
8050 |
checkParse( |
8051 |
s.toCharArray(), |
8052 |
expectedDietUnitToString, |
8053 |
expectedDietPlusBodyUnitToString, |
8054 |
expectedDietPlusBodyPlusStatementsRecoveryUnitToString, |
8055 |
expectedFullUnitToString, |
8056 |
expectedCompletionDietUnitToString, testName); |
8057 |
} |
7835 |
} |
8058 |
} |