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_experimental/src/generated/java_core.dart'; | 4 import 'package:analyzer_experimental/src/generated/java_core.dart'; |
5 import 'package:analyzer_experimental/src/generated/java_junit.dart'; | 5 import 'package:analyzer_experimental/src/generated/java_junit.dart'; |
6 import 'package:analyzer_experimental/src/generated/source.dart'; | 6 import 'package:analyzer_experimental/src/generated/source.dart'; |
7 import 'package:analyzer_experimental/src/generated/error.dart'; | 7 import 'package:analyzer_experimental/src/generated/error.dart'; |
8 import 'package:analyzer_experimental/src/generated/scanner.dart'; | 8 import 'package:analyzer_experimental/src/generated/scanner.dart'; |
9 import 'package:analyzer_experimental/src/generated/ast.dart' show ASTNode, Node
Locator; | 9 import 'package:analyzer_experimental/src/generated/ast.dart' show ASTNode, Node
Locator; |
10 import 'package:analyzer_experimental/src/generated/element.dart' show Interface
Type, MethodElement, PropertyAccessorElement; | 10 import 'package:analyzer_experimental/src/generated/element.dart' show Interface
Type, MethodElement, PropertyAccessorElement; |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 } | 497 } |
498 } | 498 } |
499 | 499 |
500 /** | 500 /** |
501 * Assert that the given list is non-`null` and has exactly expected elements. | 501 * Assert that the given list is non-`null` and has exactly expected elements. |
502 * | 502 * |
503 * @param list the list being tested | 503 * @param list the list being tested |
504 * @param expectedElements the expected elements | 504 * @param expectedElements the expected elements |
505 * @throws AssertionFailedError if the list is `null` or does not have the exp
ected elements | 505 * @throws AssertionFailedError if the list is `null` or does not have the exp
ected elements |
506 */ | 506 */ |
507 static void assertExactElements(List<Object> list, List<Object> expectedElemen
ts) { | 507 static void assertExactElements(List list, List<Object> expectedElements) { |
508 int expectedSize = expectedElements.length; | 508 int expectedSize = expectedElements.length; |
509 if (list == null) { | 509 if (list == null) { |
510 JUnitTestCase.fail("Expected list of size ${expectedSize}; found null"); | 510 JUnitTestCase.fail("Expected list of size ${expectedSize}; found null"); |
511 } | 511 } |
512 if (list.length != expectedSize) { | 512 if (list.length != expectedSize) { |
513 JUnitTestCase.fail("Expected list of size ${expectedSize}; contained ${lis
t.length} elements"); | 513 JUnitTestCase.fail("Expected list of size ${expectedSize}; contained ${lis
t.length} elements"); |
514 } | 514 } |
515 for (int i = 0; i < expectedSize; i++) { | 515 for (int i = 0; i < expectedSize; i++) { |
516 Object element = list[i]; | 516 Object element = list[i]; |
517 Object expectedElement = expectedElements[i]; | 517 Object expectedElement = expectedElements[i]; |
(...skipping 28 matching lines...) Expand all Loading... |
546 } | 546 } |
547 } | 547 } |
548 | 548 |
549 /** | 549 /** |
550 * Assert that the given list is non-`null` and has exactly expected elements. | 550 * Assert that the given list is non-`null` and has exactly expected elements. |
551 * | 551 * |
552 * @param set the list being tested | 552 * @param set the list being tested |
553 * @param expectedElements the expected elements | 553 * @param expectedElements the expected elements |
554 * @throws AssertionFailedError if the list is `null` or does not have the exp
ected elements | 554 * @throws AssertionFailedError if the list is `null` or does not have the exp
ected elements |
555 */ | 555 */ |
556 static void assertExactElements3(Set<Object> set, List<Object> expectedElement
s) { | 556 static void assertExactElements3(Set set, List<Object> expectedElements) { |
557 int expectedSize = expectedElements.length; | 557 int expectedSize = expectedElements.length; |
558 if (set == null) { | 558 if (set == null) { |
559 JUnitTestCase.fail("Expected list of size ${expectedSize}; found null"); | 559 JUnitTestCase.fail("Expected list of size ${expectedSize}; found null"); |
560 } | 560 } |
561 if (set.length != expectedSize) { | 561 if (set.length != expectedSize) { |
562 JUnitTestCase.fail("Expected list of size ${expectedSize}; contained ${set
.length} elements"); | 562 JUnitTestCase.fail("Expected list of size ${expectedSize}; contained ${set
.length} elements"); |
563 } | 563 } |
564 for (int i = 0; i < expectedSize; i++) { | 564 for (int i = 0; i < expectedSize; i++) { |
565 Object expectedElement = expectedElements[i]; | 565 Object expectedElement = expectedElements[i]; |
566 if (!set.contains(expectedElement)) { | 566 if (!set.contains(expectedElement)) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 } | 620 } |
621 | 621 |
622 /** | 622 /** |
623 * Assert that the given list is non-`null` and has the expected number of ele
ments. | 623 * Assert that the given list is non-`null` and has the expected number of ele
ments. |
624 * | 624 * |
625 * @param expectedSize the expected number of elements | 625 * @param expectedSize the expected number of elements |
626 * @param list the list being tested | 626 * @param list the list being tested |
627 * @throws AssertionFailedError if the list is `null` or does not have the exp
ected number | 627 * @throws AssertionFailedError if the list is `null` or does not have the exp
ected number |
628 * of elements | 628 * of elements |
629 */ | 629 */ |
630 static void assertSize(int expectedSize, List<Object> list) { | 630 static void assertSize(int expectedSize, List list) { |
631 if (list == null) { | 631 if (list == null) { |
632 JUnitTestCase.fail("Expected list of size ${expectedSize}; found null"); | 632 JUnitTestCase.fail("Expected list of size ${expectedSize}; found null"); |
633 } else if (list.length != expectedSize) { | 633 } else if (list.length != expectedSize) { |
634 JUnitTestCase.fail("Expected list of size ${expectedSize}; contained ${lis
t.length} elements"); | 634 JUnitTestCase.fail("Expected list of size ${expectedSize}; contained ${lis
t.length} elements"); |
635 } | 635 } |
636 } | 636 } |
637 | 637 |
638 /** | 638 /** |
639 * Assert that the given map is non-`null` and has the expected number of elem
ents. | 639 * Assert that the given map is non-`null` and has the expected number of elem
ents. |
640 * | 640 * |
641 * @param expectedSize the expected number of elements | 641 * @param expectedSize the expected number of elements |
642 * @param map the map being tested | 642 * @param map the map being tested |
643 * @throws AssertionFailedError if the map is `null` or does not have the expe
cted number of | 643 * @throws AssertionFailedError if the map is `null` or does not have the expe
cted number of |
644 * elements | 644 * elements |
645 */ | 645 */ |
646 static void assertSize2(int expectedSize, Map<Object, Object> map) { | 646 static void assertSize2(int expectedSize, Map map) { |
647 if (map == null) { | 647 if (map == null) { |
648 JUnitTestCase.fail("Expected map of size ${expectedSize}; found null"); | 648 JUnitTestCase.fail("Expected map of size ${expectedSize}; found null"); |
649 } else if (map.length != expectedSize) { | 649 } else if (map.length != expectedSize) { |
650 JUnitTestCase.fail("Expected map of size ${expectedSize}; contained ${map.
length} elements"); | 650 JUnitTestCase.fail("Expected map of size ${expectedSize}; contained ${map.
length} elements"); |
651 } | 651 } |
652 } | 652 } |
653 | 653 |
654 /** | 654 /** |
655 * Assert that the given set is non-`null` and has the expected number of elem
ents. | 655 * Assert that the given set is non-`null` and has the expected number of elem
ents. |
656 * | 656 * |
657 * @param expectedSize the expected number of elements | 657 * @param expectedSize the expected number of elements |
658 * @param set the set being tested | 658 * @param set the set being tested |
659 * @throws AssertionFailedError if the set is `null` or does not have the expe
cted number of | 659 * @throws AssertionFailedError if the set is `null` or does not have the expe
cted number of |
660 * elements | 660 * elements |
661 */ | 661 */ |
662 static void assertSize3(int expectedSize, Set<Object> set) { | 662 static void assertSize3(int expectedSize, Set set) { |
663 if (set == null) { | 663 if (set == null) { |
664 JUnitTestCase.fail("Expected set of size ${expectedSize}; found null"); | 664 JUnitTestCase.fail("Expected set of size ${expectedSize}; found null"); |
665 } else if (set.length != expectedSize) { | 665 } else if (set.length != expectedSize) { |
666 JUnitTestCase.fail("Expected set of size ${expectedSize}; contained ${set.
length} elements"); | 666 JUnitTestCase.fail("Expected set of size ${expectedSize}; contained ${set.
length} elements"); |
667 } | 667 } |
668 } | 668 } |
669 | 669 |
670 /** | 670 /** |
671 * Convert the given array of lines into a single source string. | 671 * Convert the given array of lines into a single source string. |
672 * | 672 * |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 return trampoline(target, arguments[0], arguments[1]); | 842 return trampoline(target, arguments[0], arguments[1]); |
843 case 3: | 843 case 3: |
844 return trampoline(target, arguments[0], arguments[1], arguments[2]); | 844 return trampoline(target, arguments[0], arguments[1], arguments[2]); |
845 case 4: | 845 case 4: |
846 return trampoline(target, arguments[0], arguments[1], arguments[2], argu
ments[3]); | 846 return trampoline(target, arguments[0], arguments[1], arguments[2], argu
ments[3]); |
847 default: | 847 default: |
848 throw new IllegalArgumentException("Not implemented for > 4 arguments"); | 848 throw new IllegalArgumentException("Not implemented for > 4 arguments"); |
849 } | 849 } |
850 } | 850 } |
851 } | 851 } |
OLD | NEW |