| 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 'package:analyzer/src/generated/java_core.dart'; | 6 import 'package:analyzer/src/generated/java_core.dart'; |
| 7 import 'package:analyzer/src/generated/java_junit.dart'; | 7 import 'package:analyzer/src/generated/java_junit.dart'; |
| 8 import 'package:analyzer/src/generated/source.dart'; | 8 import 'package:analyzer/src/generated/source.dart'; |
| 9 import 'package:analyzer/src/generated/error.dart'; | 9 import 'package:analyzer/src/generated/error.dart'; |
| 10 import 'package:analyzer/src/generated/scanner.dart'; | 10 import 'package:analyzer/src/generated/scanner.dart'; |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 int expectedSize = expectedElements.length; | 528 int expectedSize = expectedElements.length; |
| 529 if (list == null) { | 529 if (list == null) { |
| 530 JUnitTestCase.fail("Expected list of size ${expectedSize}; found null"); | 530 JUnitTestCase.fail("Expected list of size ${expectedSize}; found null"); |
| 531 } | 531 } |
| 532 if (list.length != expectedSize) { | 532 if (list.length != expectedSize) { |
| 533 JUnitTestCase.fail("Expected list of size ${expectedSize}; contained ${lis
t.length} elements"); | 533 JUnitTestCase.fail("Expected list of size ${expectedSize}; contained ${lis
t.length} elements"); |
| 534 } | 534 } |
| 535 for (int i = 0; i < expectedSize; i++) { | 535 for (int i = 0; i < expectedSize; i++) { |
| 536 Object element = list[i]; | 536 Object element = list[i]; |
| 537 Object expectedElement = expectedElements[i]; | 537 Object expectedElement = expectedElements[i]; |
| 538 if (!element == expectedElement) { | 538 if (element != expectedElement) { |
| 539 JUnitTestCase.fail("Expected ${expectedElement} at [${i}]; found ${eleme
nt}"); | 539 JUnitTestCase.fail("Expected ${expectedElement} at [${i}]; found ${eleme
nt}"); |
| 540 } | 540 } |
| 541 } | 541 } |
| 542 } | 542 } |
| 543 | 543 |
| 544 /** | 544 /** |
| 545 * Assert that the given array is non-`null` and has exactly expected elements
. | 545 * Assert that the given array is non-`null` and has exactly expected elements
. |
| 546 * | 546 * |
| 547 * @param array the array being tested | 547 * @param array the array being tested |
| 548 * @param expectedElements the expected elements | 548 * @param expectedElements the expected elements |
| 549 * @throws AssertionFailedError if the array is `null` or does not have the ex
pected | 549 * @throws AssertionFailedError if the array is `null` or does not have the ex
pected |
| 550 * elements | 550 * elements |
| 551 */ | 551 */ |
| 552 static void assertExactElements2(List<Object> array, List<Object> expectedElem
ents) { | 552 static void assertExactElements2(List<Object> array, List<Object> expectedElem
ents) { |
| 553 int expectedSize = expectedElements.length; | 553 int expectedSize = expectedElements.length; |
| 554 if (array == null) { | 554 if (array == null) { |
| 555 JUnitTestCase.fail("Expected array of size ${expectedSize}; found null"); | 555 JUnitTestCase.fail("Expected array of size ${expectedSize}; found null"); |
| 556 } | 556 } |
| 557 if (array.length != expectedSize) { | 557 if (array.length != expectedSize) { |
| 558 JUnitTestCase.fail("Expected array of size ${expectedSize}; contained ${ar
ray.length} elements"); | 558 JUnitTestCase.fail("Expected array of size ${expectedSize}; contained ${ar
ray.length} elements"); |
| 559 } | 559 } |
| 560 for (int i = 0; i < expectedSize; i++) { | 560 for (int i = 0; i < expectedSize; i++) { |
| 561 Object element = array[i]; | 561 Object element = array[i]; |
| 562 Object expectedElement = expectedElements[i]; | 562 Object expectedElement = expectedElements[i]; |
| 563 if (!element == expectedElement) { | 563 if (element != expectedElement) { |
| 564 JUnitTestCase.fail("Expected ${expectedElement} at [${i}]; found ${eleme
nt}"); | 564 JUnitTestCase.fail("Expected ${expectedElement} at [${i}]; found ${eleme
nt}"); |
| 565 } | 565 } |
| 566 } | 566 } |
| 567 } | 567 } |
| 568 | 568 |
| 569 /** | 569 /** |
| 570 * Assert that the given list is non-`null` and has exactly expected elements. | 570 * Assert that the given list is non-`null` and has exactly expected elements. |
| 571 * | 571 * |
| 572 * @param set the list being tested | 572 * @param set the list being tested |
| 573 * @param expectedElements the expected elements | 573 * @param expectedElements the expected elements |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 return trampoline(target, arguments[0], arguments[1]); | 866 return trampoline(target, arguments[0], arguments[1]); |
| 867 case 3: | 867 case 3: |
| 868 return trampoline(target, arguments[0], arguments[1], arguments[2]); | 868 return trampoline(target, arguments[0], arguments[1], arguments[2]); |
| 869 case 4: | 869 case 4: |
| 870 return trampoline(target, arguments[0], arguments[1], arguments[2], argu
ments[3]); | 870 return trampoline(target, arguments[0], arguments[1], arguments[2], argu
ments[3]); |
| 871 default: | 871 default: |
| 872 throw new IllegalArgumentException("Not implemented for > 4 arguments"); | 872 throw new IllegalArgumentException("Not implemented for > 4 arguments"); |
| 873 } | 873 } |
| 874 } | 874 } |
| 875 } | 875 } |
| OLD | NEW |