Lines 1124-1129
Link Here
|
1124 |
elements |
1124 |
elements |
1125 |
); |
1125 |
); |
1126 |
} |
1126 |
} |
|
|
1127 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=180683 |
1128 |
public void testUnicode2() throws JavaModelException { |
1129 |
this.workingCopies = new ICompilationUnit[1]; |
1130 |
this.workingCopies[0] = getWorkingCopy( |
1131 |
"/Resolve/src/test/B.java", |
1132 |
"package test;\n"+ |
1133 |
"public class \\u0042 {\n" + |
1134 |
" void foo() {\n" + |
1135 |
" \\u0042 var = null;\n" + |
1136 |
" }\n" + |
1137 |
"}"); |
1138 |
|
1139 |
String str = this.workingCopies[0].getSource(); |
1140 |
int start = str.lastIndexOf("42"); |
1141 |
int length = "".length(); |
1142 |
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length, this.wcOwner); |
1143 |
|
1144 |
assertElementsEqual( |
1145 |
"Unexpected elements", |
1146 |
"B [in [Working copy] B.java [in test [in src [in Resolve]]]]", |
1147 |
elements |
1148 |
); |
1149 |
} |
1150 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=180683 |
1151 |
public void testUnicode3() throws JavaModelException { |
1152 |
this.workingCopies = new ICompilationUnit[1]; |
1153 |
this.workingCopies[0] = getWorkingCopy( |
1154 |
"/Resolve/src/test/B.java", |
1155 |
"package test;\n"+ |
1156 |
"public class \\u0042 {\n" + |
1157 |
" void foo() {\n" + |
1158 |
" \\u004"); |
1159 |
|
1160 |
String str = this.workingCopies[0].getSource(); |
1161 |
int start = str.lastIndexOf("4"); |
1162 |
int length = "".length(); |
1163 |
IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length, this.wcOwner); |
1164 |
|
1165 |
assertElementsEqual( |
1166 |
"Unexpected elements", |
1167 |
"", |
1168 |
elements |
1169 |
); |
1170 |
} |
1127 |
/** |
1171 |
/** |
1128 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=47177 |
1172 |
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=47177 |
1129 |
*/ |
1173 |
*/ |