| OLD | NEW |
| 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 source16 = error.source; |
| 291 LineInfo lineInfo = _lineInfoMap[source16]; | 291 LineInfo lineInfo = _lineInfoMap[source16]; |
| 292 writer.println(); | 292 writer.newLine(); |
| 293 if (lineInfo == null) { | 293 if (lineInfo == null) { |
| 294 int offset10 = error.offset; | 294 int offset10 = 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)", [source16 == null ? "" : source16.shor
tName, error.errorCode, offset10, offset10 + 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)", [source16 == null ? "" : source16.s
hortName, error.errorCode, location.lineNumber, location.columnNumber, error.len
gth]); |
| 299 } | 299 } |
| 300 } | 300 } |
| 301 writer.println(); | 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 source17 = error.source; |
| 307 LineInfo lineInfo = _lineInfoMap[source17]; | 307 LineInfo lineInfo = _lineInfoMap[source17]; |
| 308 writer.println(); | 308 writer.newLine(); |
| 309 if (lineInfo == null) { | 309 if (lineInfo == null) { |
| 310 int offset11 = error.offset; | 310 int offset11 = 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", [source17 == null ? "" : source17.
shortName, error.errorCode, offset11, offset11 + 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", [source17 == null ? "" : source
17.shortName, error.errorCode, location.lineNumber, location.columnNumber, error
.length, error.message]); |
| 315 } | 315 } |
| 316 } | 316 } |
| 317 JUnitTestCase.fail(writer.toString()); | 317 JUnitTestCase.fail(writer.toString()); |
| 318 } | 318 } |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 } | 562 } |
| 563 } | 563 } |
| 564 /** | 564 /** |
| 565 * Convert the given array of lines into a single source string. | 565 * Convert the given array of lines into a single source string. |
| 566 * @param lines the lines to be merged into a single source string | 566 * @param lines the lines to be merged into a single source string |
| 567 * @return the source string composed of the given lines | 567 * @return the source string composed of the given lines |
| 568 */ | 568 */ |
| 569 static String createSource(List<String> lines) { | 569 static String createSource(List<String> lines) { |
| 570 PrintStringWriter writer = new PrintStringWriter(); | 570 PrintStringWriter writer = new PrintStringWriter(); |
| 571 for (String line in lines) { | 571 for (String line in lines) { |
| 572 writer.printlnObject(line); | 572 writer.println(line); |
| 573 } | 573 } |
| 574 return writer.toString(); | 574 return writer.toString(); |
| 575 } | 575 } |
| 576 /** | 576 /** |
| 577 * Calculate the offset where the given strings differ. | 577 * Calculate the offset where the given strings differ. |
| 578 * @param str1 the first String to compare | 578 * @param str1 the first String to compare |
| 579 * @param str2 the second String to compare | 579 * @param str2 the second String to compare |
| 580 * @return the offset at which the strings differ (or <code>-1</code> if they
do not) | 580 * @return the offset at which the strings differ (or <code>-1</code> if they
do not) |
| 581 */ | 581 */ |
| 582 static int getDiffPos(String str1, String str2) { | 582 static int getDiffPos(String str1, String str2) { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |