Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: pkg/analyzer_experimental/test/generated/test_support.dart

Issue 14161021: Generate unique names less aggressively. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 3
4 library engine.test_support; 4 library engine.test_support;
5 5
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'dart:uri'; 7 import 'dart:uri';
8 import 'package:analyzer_experimental/src/generated/java_core.dart'; 8 import 'package:analyzer_experimental/src/generated/java_core.dart';
9 import 'package:analyzer_experimental/src/generated/java_engine.dart'; 9 import 'package:analyzer_experimental/src/generated/java_engine.dart';
10 import 'package:analyzer_experimental/src/generated/java_junit.dart'; 10 import 'package:analyzer_experimental/src/generated/java_junit.dart';
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 * information has been associated with the source. 209 * information has been associated with the source.
210 * @param source the source with which the line information is associated 210 * @param source the source with which the line information is associated
211 * @return the line information associated with the source 211 * @return the line information associated with the source
212 */ 212 */
213 LineInfo getLineInfo(Source source) => _lineInfoMap[source]; 213 LineInfo getLineInfo(Source source) => _lineInfoMap[source];
214 /** 214 /**
215 * Return {@code true} if an error with the given error code has been gathered . 215 * Return {@code true} if an error with the given error code has been gathered .
216 * @param errorCode the error code being searched for 216 * @param errorCode the error code being searched for
217 * @return {@code true} if an error with the given error code has been gathere d 217 * @return {@code true} if an error with the given error code has been gathere d
218 */ 218 */
219 bool hasError(ErrorCode errorCode5) { 219 bool hasError(ErrorCode errorCode2) {
220 for (AnalysisError error in _errors) { 220 for (AnalysisError error in _errors) {
221 if (identical(error.errorCode, errorCode5)) { 221 if (identical(error.errorCode, errorCode2)) {
222 return true; 222 return true;
223 } 223 }
224 } 224 }
225 return false; 225 return false;
226 } 226 }
227 /** 227 /**
228 * Return {@code true} if at least one error has been gathered. 228 * Return {@code true} if at least one error has been gathered.
229 * @return {@code true} if at least one error has been gathered 229 * @return {@code true} if at least one error has been gathered
230 */ 230 */
231 bool hasErrors() => _errors.length > 0; 231 bool hasErrors() => _errors.length > 0;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 * is ignored. 280 * is ignored.
281 * @param errorCodes the errors that should have been gathered 281 * @param errorCodes the errors that should have been gathered
282 * @throws AssertionFailedError with 282 * @throws AssertionFailedError with
283 */ 283 */
284 void fail(List<AnalysisError> expectedErrors) { 284 void fail(List<AnalysisError> expectedErrors) {
285 PrintStringWriter writer = new PrintStringWriter(); 285 PrintStringWriter writer = new PrintStringWriter();
286 writer.print("Expected "); 286 writer.print("Expected ");
287 writer.print(expectedErrors.length); 287 writer.print(expectedErrors.length);
288 writer.print(" errors:"); 288 writer.print(" errors:");
289 for (AnalysisError error in expectedErrors) { 289 for (AnalysisError error in expectedErrors) {
290 Source source16 = error.source; 290 Source source2 = error.source;
291 LineInfo lineInfo = _lineInfoMap[source16]; 291 LineInfo lineInfo = _lineInfoMap[source2];
292 writer.newLine(); 292 writer.newLine();
293 if (lineInfo == null) { 293 if (lineInfo == null) {
294 int offset10 = error.offset; 294 int offset2 = error.offset;
295 writer.printf(" %s %s (%d..%d)", [source16 == null ? "" : source16.shor tName, error.errorCode, offset10, offset10 + error.length]); 295 writer.printf(" %s %s (%d..%d)", [source2 == null ? "" : source2.shortN ame, error.errorCode, offset2, offset2 + error.length]);
296 } else { 296 } else {
297 LineInfo_Location location = lineInfo.getLocation(error.offset); 297 LineInfo_Location location = lineInfo.getLocation(error.offset);
298 writer.printf(" %s %s (%d, %d/%d)", [source16 == null ? "" : source16.s hortName, error.errorCode, location.lineNumber, location.columnNumber, error.len gth]); 298 writer.printf(" %s %s (%d, %d/%d)", [source2 == null ? "" : source2.sho rtName, error.errorCode, location.lineNumber, location.columnNumber, error.lengt h]);
299 } 299 }
300 } 300 }
301 writer.newLine(); 301 writer.newLine();
302 writer.print("found "); 302 writer.print("found ");
303 writer.print(_errors.length); 303 writer.print(_errors.length);
304 writer.print(" errors:"); 304 writer.print(" errors:");
305 for (AnalysisError error in _errors) { 305 for (AnalysisError error in _errors) {
306 Source source17 = error.source; 306 Source source3 = error.source;
307 LineInfo lineInfo = _lineInfoMap[source17]; 307 LineInfo lineInfo = _lineInfoMap[source3];
308 writer.newLine(); 308 writer.newLine();
309 if (lineInfo == null) { 309 if (lineInfo == null) {
310 int offset11 = error.offset; 310 int offset3 = error.offset;
311 writer.printf(" %s %s (%d..%d): %s", [source17 == null ? "" : source17. shortName, error.errorCode, offset11, offset11 + error.length, error.message]); 311 writer.printf(" %s %s (%d..%d): %s", [source3 == null ? "" : source3.sh ortName, error.errorCode, offset3, offset3 + error.length, error.message]);
312 } else { 312 } else {
313 LineInfo_Location location = lineInfo.getLocation(error.offset); 313 LineInfo_Location location = lineInfo.getLocation(error.offset);
314 writer.printf(" %s %s (%d, %d/%d): %s", [source17 == null ? "" : source 17.shortName, error.errorCode, location.lineNumber, location.columnNumber, error .length, error.message]); 314 writer.printf(" %s %s (%d, %d/%d): %s", [source3 == null ? "" : source3 .shortName, error.errorCode, location.lineNumber, location.columnNumber, error.l ength, error.message]);
315 } 315 }
316 } 316 }
317 JUnitTestCase.fail(writer.toString()); 317 JUnitTestCase.fail(writer.toString());
318 } 318 }
319 /** 319 /**
320 * Search through the given list of errors for an error that is equal to the t arget error. If one 320 * Search through the given list of errors for an error that is equal to the t arget error. If one
321 * is found, remove it from the list and return {@code true}, otherwise return {@code false}without modifying the list. 321 * is found, remove it from the list and return {@code true}, otherwise return {@code false}without modifying the list.
322 * @param errors the errors through which we are searching 322 * @param errors the errors through which we are searching
323 * @param targetError the error being searched for 323 * @param targetError the error being searched for
324 * @return {@code true} if the error is found and removed from the list 324 * @return {@code true} if the error is found and removed from the list
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 return trampoline(target, arguments[0], arguments[1]); 691 return trampoline(target, arguments[0], arguments[1]);
692 case 3: 692 case 3:
693 return trampoline(target, arguments[0], arguments[1], arguments[2]); 693 return trampoline(target, arguments[0], arguments[1], arguments[2]);
694 case 4: 694 case 4:
695 return trampoline(target, arguments[0], arguments[1], arguments[2], argu ments[3]); 695 return trampoline(target, arguments[0], arguments[1], arguments[2], argu ments[3]);
696 default: 696 default:
697 throw new IllegalArgumentException("Not implemented for > 4 arguments"); 697 throw new IllegalArgumentException("Not implemented for > 4 arguments");
698 } 698 }
699 } 699 }
700 } 700 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698