| 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 library engine.test_support; | 3 library engine.test_support; |
| 4 import 'package:analyzer/src/generated/java_core.dart'; | 4 import 'package:analyzer/src/generated/java_core.dart'; |
| 5 import 'package:analyzer/src/generated/java_junit.dart'; | 5 import 'package:analyzer/src/generated/java_junit.dart'; |
| 6 import 'package:analyzer/src/generated/source.dart'; | 6 import 'package:analyzer/src/generated/source.dart'; |
| 7 import 'package:analyzer/src/generated/error.dart'; | 7 import 'package:analyzer/src/generated/error.dart'; |
| 8 import 'package:analyzer/src/generated/scanner.dart'; | 8 import 'package:analyzer/src/generated/scanner.dart'; |
| 9 import 'package:analyzer/src/generated/ast.dart' show ASTNode, NodeLocator; | 9 import 'package:analyzer/src/generated/ast.dart' show ASTNode, NodeLocator; |
| 10 import 'package:analyzer/src/generated/element.dart' show InterfaceType, MethodE
lement, PropertyAccessorElement; | 10 import 'package:analyzer/src/generated/element.dart' show InterfaceType, MethodE
lement, PropertyAccessorElement; |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 _lineInfoMap[source] = lineInfo; | 276 _lineInfoMap[source] = lineInfo; |
| 277 } | 277 } |
| 278 | 278 |
| 279 /** | 279 /** |
| 280 * Return `true` if the two errors are equivalent. | 280 * Return `true` if the two errors are equivalent. |
| 281 * | 281 * |
| 282 * @param firstError the first error being compared | 282 * @param firstError the first error being compared |
| 283 * @param secondError the second error being compared | 283 * @param secondError the second error being compared |
| 284 * @return `true` if the two errors are equivalent | 284 * @return `true` if the two errors are equivalent |
| 285 */ | 285 */ |
| 286 bool equals3(AnalysisError firstError, AnalysisError secondError) => identical
(firstError.errorCode, secondError.errorCode) && firstError.offset == secondErro
r.offset && firstError.length == secondError.length && equals4(firstError.source
, secondError.source); | 286 bool equals4(AnalysisError firstError, AnalysisError secondError) => identical
(firstError.errorCode, secondError.errorCode) && firstError.offset == secondErro
r.offset && firstError.length == secondError.length && equals5(firstError.source
, secondError.source); |
| 287 | 287 |
| 288 /** | 288 /** |
| 289 * Return `true` if the two sources are equivalent. | 289 * Return `true` if the two sources are equivalent. |
| 290 * | 290 * |
| 291 * @param firstSource the first source being compared | 291 * @param firstSource the first source being compared |
| 292 * @param secondSource the second source being compared | 292 * @param secondSource the second source being compared |
| 293 * @return `true` if the two sources are equivalent | 293 * @return `true` if the two sources are equivalent |
| 294 */ | 294 */ |
| 295 bool equals4(Source firstSource, Source secondSource) { | 295 bool equals5(Source firstSource, Source secondSource) { |
| 296 if (firstSource == null) { | 296 if (firstSource == null) { |
| 297 return secondSource == null; | 297 return secondSource == null; |
| 298 } else if (secondSource == null) { | 298 } else if (secondSource == null) { |
| 299 return false; | 299 return false; |
| 300 } | 300 } |
| 301 return firstSource == secondSource; | 301 return firstSource == secondSource; |
| 302 } | 302 } |
| 303 | 303 |
| 304 /** | 304 /** |
| 305 * Assert that the number of errors that have been gathered matches the number
of errors that are | 305 * Assert that the number of errors that have been gathered matches the number
of errors that are |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 * Search through the given list of errors for an error that is equal to the t
arget error. If one | 369 * Search through the given list of errors for an error that is equal to the t
arget error. If one |
| 370 * is found, remove it from the list and return `true`, otherwise return `fals
e` | 370 * is found, remove it from the list and return `true`, otherwise return `fals
e` |
| 371 * without modifying the list. | 371 * without modifying the list. |
| 372 * | 372 * |
| 373 * @param errors the errors through which we are searching | 373 * @param errors the errors through which we are searching |
| 374 * @param targetError the error being searched for | 374 * @param targetError the error being searched for |
| 375 * @return `true` if the error is found and removed from the list | 375 * @return `true` if the error is found and removed from the list |
| 376 */ | 376 */ |
| 377 bool foundAndRemoved(List<AnalysisError> errors, AnalysisError targetError) { | 377 bool foundAndRemoved(List<AnalysisError> errors, AnalysisError targetError) { |
| 378 for (AnalysisError error in errors) { | 378 for (AnalysisError error in errors) { |
| 379 if (equals3(error, targetError)) { | 379 if (equals4(error, targetError)) { |
| 380 errors.remove(error); | 380 errors.remove(error); |
| 381 return true; | 381 return true; |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 return true; | 384 return true; |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 /** | 387 /** |
| 388 * The class `EngineTestCase` defines utility methods for making assertions. | 388 * The class `EngineTestCase` defines utility methods for making assertions. |
| 389 */ | 389 */ |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 return trampoline(target, arguments[0], arguments[1]); | 851 return trampoline(target, arguments[0], arguments[1]); |
| 852 case 3: | 852 case 3: |
| 853 return trampoline(target, arguments[0], arguments[1], arguments[2]); | 853 return trampoline(target, arguments[0], arguments[1], arguments[2]); |
| 854 case 4: | 854 case 4: |
| 855 return trampoline(target, arguments[0], arguments[1], arguments[2], argu
ments[3]); | 855 return trampoline(target, arguments[0], arguments[1], arguments[2], argu
ments[3]); |
| 856 default: | 856 default: |
| 857 throw new IllegalArgumentException("Not implemented for > 4 arguments"); | 857 throw new IllegalArgumentException("Not implemented for > 4 arguments"); |
| 858 } | 858 } |
| 859 } | 859 } |
| 860 } | 860 } |
| OLD | NEW |