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

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

Issue 24481002: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 if (expectedToken is KeywordToken) { 606 if (expectedToken is KeywordToken) {
607 assertInstanceOf(KeywordToken, actualToken); 607 assertInstanceOf(KeywordToken, actualToken);
608 JUnitTestCase.assertEquals(((expectedToken as KeywordToken)).keyword, ((ac tualToken as KeywordToken)).keyword); 608 JUnitTestCase.assertEquals(((expectedToken as KeywordToken)).keyword, ((ac tualToken as KeywordToken)).keyword);
609 } else if (expectedToken is StringToken) { 609 } else if (expectedToken is StringToken) {
610 assertInstanceOf(StringToken, actualToken); 610 assertInstanceOf(StringToken, actualToken);
611 JUnitTestCase.assertEquals(((expectedToken as StringToken)).lexeme, ((actu alToken as StringToken)).lexeme); 611 JUnitTestCase.assertEquals(((expectedToken as StringToken)).lexeme, ((actu alToken as StringToken)).lexeme);
612 } 612 }
613 } 613 }
614 614
615 /** 615 /**
616 * Assert that the given collection is non-`null` and has the expected number of elements.
617 *
618 * @param expectedSize the expected number of elements
619 * @param c the collection being tested
620 * @throws AssertionFailedError if the list is `null` or does not have the exp ected number
621 * of elements
622 */
623 static void assertCollectionSize(int expectedSize, Iterable c) {
624 if (c == null) {
625 JUnitTestCase.fail("Expected collection of size ${expectedSize}; found nul l");
626 } else if (c.length != expectedSize) {
627 JUnitTestCase.fail("Expected collection of size ${expectedSize}; contained ${c.length} elements");
628 }
629 }
630
631 /**
616 * Assert that the given list is non-`null` and has the expected number of ele ments. 632 * Assert that the given list is non-`null` and has the expected number of ele ments.
617 * 633 *
618 * @param expectedSize the expected number of elements 634 * @param expectedSize the expected number of elements
619 * @param list the list being tested 635 * @param list the list being tested
620 * @throws AssertionFailedError if the list is `null` or does not have the exp ected number 636 * @throws AssertionFailedError if the list is `null` or does not have the exp ected number
621 * of elements 637 * of elements
622 */ 638 */
623 static void assertSize(int expectedSize, List list) { 639 static void assertSize(int expectedSize, List list) {
624 if (list == null) { 640 if (list == null) {
625 JUnitTestCase.fail("Expected list of size ${expectedSize}; found null"); 641 JUnitTestCase.fail("Expected list of size ${expectedSize}; found null");
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 return trampoline(target, arguments[0], arguments[1]); 851 return trampoline(target, arguments[0], arguments[1]);
836 case 3: 852 case 3:
837 return trampoline(target, arguments[0], arguments[1], arguments[2]); 853 return trampoline(target, arguments[0], arguments[1], arguments[2]);
838 case 4: 854 case 4:
839 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]);
840 default: 856 default:
841 throw new IllegalArgumentException("Not implemented for > 4 arguments"); 857 throw new IllegalArgumentException("Not implemented for > 4 arguments");
842 } 858 }
843 } 859 }
844 } 860 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/test/generated/scanner_test.dart ('k') | pkg/analyzer_experimental/test/services/test_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698