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

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

Issue 27278004: 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.ast_test; 3 library engine.ast_test;
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/scanner.dart'; 6 import 'package:analyzer_experimental/src/generated/scanner.dart';
7 import 'package:analyzer_experimental/src/generated/ast.dart'; 7 import 'package:analyzer_experimental/src/generated/ast.dart';
8 import 'package:analyzer_experimental/src/generated/utilities_dart.dart'; 8 import 'package:analyzer_experimental/src/generated/utilities_dart.dart';
9 import 'package:analyzer_experimental/src/generated/element.dart' show ClassElem ent; 9 import 'package:analyzer_experimental/src/generated/element.dart' show ClassElem ent;
10 import 'package:unittest/unittest.dart' as _ut; 10 import 'package:unittest/unittest.dart' as _ut;
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 static IndexExpression cascadedIndexExpression(Expression index) => new IndexE xpression.forCascade_full(TokenFactory.token3(TokenType.PERIOD_PERIOD), TokenFac tory.token3(TokenType.OPEN_SQUARE_BRACKET), index, TokenFactory.token3(TokenType .CLOSE_SQUARE_BRACKET)); 247 static IndexExpression cascadedIndexExpression(Expression index) => new IndexE xpression.forCascade_full(TokenFactory.token3(TokenType.PERIOD_PERIOD), TokenFac tory.token3(TokenType.OPEN_SQUARE_BRACKET), index, TokenFactory.token3(TokenType .CLOSE_SQUARE_BRACKET));
248 static MethodInvocation cascadedMethodInvocation(String methodName, List<Expre ssion> arguments) => new MethodInvocation.full(null, TokenFactory.token3(TokenTy pe.PERIOD_PERIOD), identifier3(methodName), argumentList(arguments)); 248 static MethodInvocation cascadedMethodInvocation(String methodName, List<Expre ssion> arguments) => new MethodInvocation.full(null, TokenFactory.token3(TokenTy pe.PERIOD_PERIOD), identifier3(methodName), argumentList(arguments));
249 static PropertyAccess cascadedPropertyAccess(String propertyName) => new Prope rtyAccess.full(null, TokenFactory.token3(TokenType.PERIOD_PERIOD), identifier3(p ropertyName)); 249 static PropertyAccess cascadedPropertyAccess(String propertyName) => new Prope rtyAccess.full(null, TokenFactory.token3(TokenType.PERIOD_PERIOD), identifier3(p ropertyName));
250 static CascadeExpression cascadeExpression(Expression target, List<Expression> cascadeSections) => new CascadeExpression.full(target, list(cascadeSections)); 250 static CascadeExpression cascadeExpression(Expression target, List<Expression> cascadeSections) => new CascadeExpression.full(target, list(cascadeSections));
251 static CatchClause catchClause(String exceptionParameter, List<Statement> stat ements) => catchClause5(null, exceptionParameter, null, statements); 251 static CatchClause catchClause(String exceptionParameter, List<Statement> stat ements) => catchClause5(null, exceptionParameter, null, statements);
252 static CatchClause catchClause2(String exceptionParameter, String stackTracePa rameter, List<Statement> statements) => catchClause5(null, exceptionParameter, s tackTraceParameter, statements); 252 static CatchClause catchClause2(String exceptionParameter, String stackTracePa rameter, List<Statement> statements) => catchClause5(null, exceptionParameter, s tackTraceParameter, statements);
253 static CatchClause catchClause3(TypeName exceptionType, List<Statement> statem ents) => catchClause5(exceptionType, null, null, statements); 253 static CatchClause catchClause3(TypeName exceptionType, List<Statement> statem ents) => catchClause5(exceptionType, null, null, statements);
254 static CatchClause catchClause4(TypeName exceptionType, String exceptionParame ter, List<Statement> statements) => catchClause5(exceptionType, exceptionParamet er, null, statements); 254 static CatchClause catchClause4(TypeName exceptionType, String exceptionParame ter, List<Statement> statements) => catchClause5(exceptionType, exceptionParamet er, null, statements);
255 static CatchClause catchClause5(TypeName exceptionType, String exceptionParame ter, String stackTraceParameter, List<Statement> statements) => new CatchClause. full(exceptionType == null ? null : TokenFactory.token4(TokenType.IDENTIFIER, "o n"), exceptionType, exceptionParameter == null ? null : TokenFactory.token(Keywo rd.CATCH), exceptionParameter == null ? null : TokenFactory.token3(TokenType.OPE N_PAREN), identifier3(exceptionParameter), stackTraceParameter == null ? null : TokenFactory.token3(TokenType.COMMA), stackTraceParameter == null ? null : ident ifier3(stackTraceParameter), exceptionParameter == null ? null : TokenFactory.to ken3(TokenType.CLOSE_PAREN), block(statements)); 255 static CatchClause catchClause5(TypeName exceptionType, String exceptionParame ter, String stackTraceParameter, List<Statement> statements) => new CatchClause. full(exceptionType == null ? null : TokenFactory.token4(TokenType.IDENTIFIER, "o n"), exceptionType, exceptionParameter == null ? null : TokenFactory.token(Keywo rd.CATCH), exceptionParameter == null ? null : TokenFactory.token3(TokenType.OPE N_PAREN), identifier3(exceptionParameter), stackTraceParameter == null ? null : TokenFactory.token3(TokenType.COMMA), stackTraceParameter == null ? null : ident ifier3(stackTraceParameter), exceptionParameter == null ? null : TokenFactory.to ken3(TokenType.CLOSE_PAREN), block(statements));
256 static ClassDeclaration classDeclaration(Keyword abstractKeyword, String name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withC lause, ImplementsClause implementsClause, List<ClassMember> members) => new Clas sDeclaration.full(null, null, abstractKeyword == null ? null : TokenFactory.toke n(abstractKeyword), TokenFactory.token(Keyword.CLASS), identifier3(name), typePa rameters, extendsClause, withClause, implementsClause, TokenFactory.token3(Token Type.OPEN_CURLY_BRACKET), list(members), TokenFactory.token3(TokenType.CLOSE_CUR LY_BRACKET)); 256 static ClassDeclaration classDeclaration(Keyword abstractKeyword, String name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withC lause, ImplementsClause implementsClause, List<ClassMember> members) => new Clas sDeclaration.full(null, null, abstractKeyword == null ? null : TokenFactory.toke n(abstractKeyword), TokenFactory.token(Keyword.CLASS), identifier3(name), typePa rameters, extendsClause, withClause, implementsClause, TokenFactory.token3(Token Type.OPEN_CURLY_BRACKET), list(members), TokenFactory.token3(TokenType.CLOSE_CUR LY_BRACKET));
257 static ClassTypeAlias classTypeAlias(String name, TypeParameterList typeParame ters, Keyword abstractKeyword, TypeName superclass, WithClause withClause, Imple mentsClause implementsClause) => new ClassTypeAlias.full(null, null, TokenFactor y.token(Keyword.TYPEDEF), identifier3(name), typeParameters, TokenFactory.token3 (TokenType.EQ), abstractKeyword == null ? null : TokenFactory.token(abstractKeyw ord), superclass, withClause, implementsClause, TokenFactory.token3(TokenType.SE MICOLON)); 257 static ClassTypeAlias classTypeAlias(String name, TypeParameterList typeParame ters, Keyword abstractKeyword, TypeName superclass, WithClause withClause, Imple mentsClause implementsClause) => new ClassTypeAlias.full(null, null, TokenFactor y.token(Keyword.CLASS), identifier3(name), typeParameters, TokenFactory.token3(T okenType.EQ), abstractKeyword == null ? null : TokenFactory.token(abstractKeywor d), superclass, withClause, implementsClause, TokenFactory.token3(TokenType.SEMI COLON));
258 static CompilationUnit compilationUnit() => compilationUnit8(null, null, null) ; 258 static CompilationUnit compilationUnit() => compilationUnit8(null, null, null) ;
259 static CompilationUnit compilationUnit2(List<CompilationUnitMember> declaratio ns) => compilationUnit8(null, null, list(declarations)); 259 static CompilationUnit compilationUnit2(List<CompilationUnitMember> declaratio ns) => compilationUnit8(null, null, list(declarations));
260 static CompilationUnit compilationUnit3(List<Directive> directives) => compila tionUnit8(null, list(directives), null); 260 static CompilationUnit compilationUnit3(List<Directive> directives) => compila tionUnit8(null, list(directives), null);
261 static CompilationUnit compilationUnit4(List<Directive> directives, List<Compi lationUnitMember> declarations) => compilationUnit8(null, directives, declaratio ns); 261 static CompilationUnit compilationUnit4(List<Directive> directives, List<Compi lationUnitMember> declarations) => compilationUnit8(null, directives, declaratio ns);
262 static CompilationUnit compilationUnit5(String scriptTag) => compilationUnit8( scriptTag, null, null); 262 static CompilationUnit compilationUnit5(String scriptTag) => compilationUnit8( scriptTag, null, null);
263 static CompilationUnit compilationUnit6(String scriptTag, List<CompilationUnit Member> declarations) => compilationUnit8(scriptTag, null, list(declarations)); 263 static CompilationUnit compilationUnit6(String scriptTag, List<CompilationUnit Member> declarations) => compilationUnit8(scriptTag, null, list(declarations));
264 static CompilationUnit compilationUnit7(String scriptTag, List<Directive> dire ctives) => compilationUnit8(scriptTag, list(directives), null); 264 static CompilationUnit compilationUnit7(String scriptTag, List<Directive> dire ctives) => compilationUnit8(scriptTag, list(directives), null);
265 static CompilationUnit compilationUnit8(String scriptTag, List<Directive> dire ctives, List<CompilationUnitMember> declarations) => new CompilationUnit.full(To kenFactory.token3(TokenType.EOF), scriptTag == null ? null : ASTFactory.scriptTa g(scriptTag), directives == null ? new List<Directive>() : directives, declarati ons == null ? new List<CompilationUnitMember>() : declarations, TokenFactory.tok en3(TokenType.EOF)); 265 static CompilationUnit compilationUnit8(String scriptTag, List<Directive> dire ctives, List<CompilationUnitMember> declarations) => new CompilationUnit.full(To kenFactory.token3(TokenType.EOF), scriptTag == null ? null : ASTFactory.scriptTa g(scriptTag), directives == null ? new List<Directive>() : directives, declarati ons == null ? new List<CompilationUnitMember>() : declarations, TokenFactory.tok en3(TokenType.EOF));
266 static ConditionalExpression conditionalExpression(Expression condition, Expre ssion thenExpression, Expression elseExpression) => new ConditionalExpression.fu ll(condition, TokenFactory.token3(TokenType.QUESTION), thenExpression, TokenFact ory.token3(TokenType.COLON), elseExpression); 266 static ConditionalExpression conditionalExpression(Expression condition, Expre ssion thenExpression, Expression elseExpression) => new ConditionalExpression.fu ll(condition, TokenFactory.token3(TokenType.QUESTION), thenExpression, TokenFact ory.token3(TokenType.COLON), elseExpression);
267 static ConstructorDeclaration constructorDeclaration(Identifier returnType, St ring name, FormalParameterList parameters, List<ConstructorInitializer> initiali zers) => new ConstructorDeclaration.full(null, null, TokenFactory.token(Keyword. EXTERNAL), null, null, returnType, name == null ? null : TokenFactory.token3(Tok enType.PERIOD), name == null ? null : identifier3(name), parameters, initializer s == null || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD) , initializers == null ? new List<ConstructorInitializer>() : initializers, null , emptyFunctionBody()); 267 static ConstructorDeclaration constructorDeclaration(Identifier returnType, St ring name, FormalParameterList parameters, List<ConstructorInitializer> initiali zers) => new ConstructorDeclaration.full(null, null, TokenFactory.token(Keyword. EXTERNAL), null, null, returnType, name == null ? null : TokenFactory.token3(Tok enType.PERIOD), name == null ? null : identifier3(name), parameters, initializer s == null || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD) , initializers == null ? new List<ConstructorInitializer>() : initializers, null , emptyFunctionBody());
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 } 794 }
795 } 795 }
796 class BreadthFirstVisitor_17 extends BreadthFirstVisitor<Object> { 796 class BreadthFirstVisitor_17 extends BreadthFirstVisitor<Object> {
797 List<ASTNode> nodes; 797 List<ASTNode> nodes;
798 BreadthFirstVisitor_17(this.nodes) : super(); 798 BreadthFirstVisitor_17(this.nodes) : super();
799 Object visitNode(ASTNode node) { 799 Object visitNode(ASTNode node) {
800 nodes.add(node); 800 nodes.add(node);
801 return super.visitNode(node); 801 return super.visitNode(node);
802 } 802 }
803 } 803 }
804 class NodeListTest extends EngineTestCase {
805 void test_add() {
806 ASTNode parent = ASTFactory.argumentList([]);
807 ASTNode firstNode = ASTFactory.booleanLiteral(true);
808 ASTNode secondNode = ASTFactory.booleanLiteral(false);
809 NodeList<ASTNode> list = new NodeList<ASTNode>(parent);
810 list.insert(0, secondNode);
811 list.insert(0, firstNode);
812 EngineTestCase.assertSize(2, list);
813 JUnitTestCase.assertSame(firstNode, list[0]);
814 JUnitTestCase.assertSame(secondNode, list[1]);
815 JUnitTestCase.assertSame(parent, firstNode.parent);
816 JUnitTestCase.assertSame(parent, secondNode.parent);
817 ASTNode thirdNode = ASTFactory.booleanLiteral(false);
818 list.insert(1, thirdNode);
819 EngineTestCase.assertSize(3, list);
820 JUnitTestCase.assertSame(firstNode, list[0]);
821 JUnitTestCase.assertSame(thirdNode, list[1]);
822 JUnitTestCase.assertSame(secondNode, list[2]);
823 JUnitTestCase.assertSame(parent, firstNode.parent);
824 JUnitTestCase.assertSame(parent, secondNode.parent);
825 JUnitTestCase.assertSame(parent, thirdNode.parent);
826 }
827 void test_add_negative() {
828 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
829 try {
830 list.insert(-1, ASTFactory.booleanLiteral(true));
831 JUnitTestCase.fail("Expected IndexOutOfBoundsException");
832 } on RangeError catch (exception) {
833 }
834 }
835 void test_add_tooBig() {
836 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
837 try {
838 list.insert(1, ASTFactory.booleanLiteral(true));
839 JUnitTestCase.fail("Expected IndexOutOfBoundsException");
840 } on RangeError catch (exception) {
841 }
842 }
843 void test_addAll() {
844 ASTNode parent = ASTFactory.argumentList([]);
845 List<ASTNode> firstNodes = new List<ASTNode>();
846 ASTNode firstNode = ASTFactory.booleanLiteral(true);
847 ASTNode secondNode = ASTFactory.booleanLiteral(false);
848 firstNodes.add(firstNode);
849 firstNodes.add(secondNode);
850 NodeList<ASTNode> list = new NodeList<ASTNode>(parent);
851 list.addAll(firstNodes);
852 EngineTestCase.assertSize(2, list);
853 JUnitTestCase.assertSame(firstNode, list[0]);
854 JUnitTestCase.assertSame(secondNode, list[1]);
855 JUnitTestCase.assertSame(parent, firstNode.parent);
856 JUnitTestCase.assertSame(parent, secondNode.parent);
857 List<ASTNode> secondNodes = new List<ASTNode>();
858 ASTNode thirdNode = ASTFactory.booleanLiteral(true);
859 ASTNode fourthNode = ASTFactory.booleanLiteral(false);
860 secondNodes.add(thirdNode);
861 secondNodes.add(fourthNode);
862 list.addAll(secondNodes);
863 EngineTestCase.assertSize(4, list);
864 JUnitTestCase.assertSame(firstNode, list[0]);
865 JUnitTestCase.assertSame(secondNode, list[1]);
866 JUnitTestCase.assertSame(thirdNode, list[2]);
867 JUnitTestCase.assertSame(fourthNode, list[3]);
868 JUnitTestCase.assertSame(parent, firstNode.parent);
869 JUnitTestCase.assertSame(parent, secondNode.parent);
870 JUnitTestCase.assertSame(parent, thirdNode.parent);
871 JUnitTestCase.assertSame(parent, fourthNode.parent);
872 }
873 void test_create() {
874 ASTNode owner = ASTFactory.argumentList([]);
875 NodeList<ASTNode> list = NodeList.create(owner);
876 JUnitTestCase.assertNotNull(list);
877 EngineTestCase.assertSize(0, list);
878 JUnitTestCase.assertSame(owner, list.owner);
879 }
880 void test_creation() {
881 ASTNode owner = ASTFactory.argumentList([]);
882 NodeList<ASTNode> list = new NodeList<ASTNode>(owner);
883 JUnitTestCase.assertNotNull(list);
884 EngineTestCase.assertSize(0, list);
885 JUnitTestCase.assertSame(owner, list.owner);
886 }
887 void test_get_negative() {
888 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
889 try {
890 list[-1];
891 JUnitTestCase.fail("Expected IndexOutOfBoundsException");
892 } on RangeError catch (exception) {
893 }
894 }
895 void test_get_tooBig() {
896 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
897 try {
898 list[1];
899 JUnitTestCase.fail("Expected IndexOutOfBoundsException");
900 } on RangeError catch (exception) {
901 }
902 }
903 void test_getBeginToken_empty() {
904 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
905 JUnitTestCase.assertNull(list.beginToken);
906 }
907 void test_getBeginToken_nonEmpty() {
908 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
909 ASTNode node = ASTFactory.parenthesizedExpression(ASTFactory.booleanLiteral( true));
910 list.add(node);
911 JUnitTestCase.assertSame(node.beginToken, list.beginToken);
912 }
913 void test_getEndToken_empty() {
914 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
915 JUnitTestCase.assertNull(list.endToken);
916 }
917 void test_getEndToken_nonEmpty() {
918 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
919 ASTNode node = ASTFactory.parenthesizedExpression(ASTFactory.booleanLiteral( true));
920 list.add(node);
921 JUnitTestCase.assertSame(node.endToken, list.endToken);
922 }
923 void test_remove() {
924 List<ASTNode> nodes = new List<ASTNode>();
925 ASTNode firstNode = ASTFactory.booleanLiteral(true);
926 ASTNode secondNode = ASTFactory.booleanLiteral(false);
927 ASTNode thirdNode = ASTFactory.booleanLiteral(true);
928 nodes.add(firstNode);
929 nodes.add(secondNode);
930 nodes.add(thirdNode);
931 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
932 list.addAll(nodes);
933 EngineTestCase.assertSize(3, list);
934 JUnitTestCase.assertSame(secondNode, list.removeAt(1));
935 EngineTestCase.assertSize(2, list);
936 JUnitTestCase.assertSame(firstNode, list[0]);
937 JUnitTestCase.assertSame(thirdNode, list[1]);
938 }
939 void test_remove_negative() {
940 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
941 try {
942 list.removeAt(-1);
943 JUnitTestCase.fail("Expected IndexOutOfBoundsException");
944 } on RangeError catch (exception) {
945 }
946 }
947 void test_remove_tooBig() {
948 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
949 try {
950 list.removeAt(1);
951 JUnitTestCase.fail("Expected IndexOutOfBoundsException");
952 } on RangeError catch (exception) {
953 }
954 }
955 void test_set() {
956 List<ASTNode> nodes = new List<ASTNode>();
957 ASTNode firstNode = ASTFactory.booleanLiteral(true);
958 ASTNode secondNode = ASTFactory.booleanLiteral(false);
959 ASTNode thirdNode = ASTFactory.booleanLiteral(true);
960 nodes.add(firstNode);
961 nodes.add(secondNode);
962 nodes.add(thirdNode);
963 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
964 list.addAll(nodes);
965 EngineTestCase.assertSize(3, list);
966 ASTNode fourthNode = ASTFactory.integer(0);
967 JUnitTestCase.assertSame(secondNode, javaListSet(list, 1, fourthNode));
968 EngineTestCase.assertSize(3, list);
969 JUnitTestCase.assertSame(firstNode, list[0]);
970 JUnitTestCase.assertSame(fourthNode, list[1]);
971 JUnitTestCase.assertSame(thirdNode, list[2]);
972 }
973 void test_set_negative() {
974 ASTNode node = ASTFactory.booleanLiteral(true);
975 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
976 try {
977 javaListSet(list, -1, node);
978 JUnitTestCase.fail("Expected IndexOutOfBoundsException");
979 } on RangeError catch (exception) {
980 }
981 }
982 void test_set_tooBig() {
983 ASTNode node = ASTFactory.booleanLiteral(true);
984 NodeList<ASTNode> list = new NodeList<ASTNode>(ASTFactory.argumentList([]));
985 try {
986 javaListSet(list, 1, node);
987 JUnitTestCase.fail("Expected IndexOutOfBoundsException");
988 } on RangeError catch (exception) {
989 }
990 }
991 static dartSuite() {
992 _ut.group('NodeListTest', () {
993 _ut.test('test_add', () {
994 final __test = new NodeListTest();
995 runJUnitTest(__test, __test.test_add);
996 });
997 _ut.test('test_addAll', () {
998 final __test = new NodeListTest();
999 runJUnitTest(__test, __test.test_addAll);
1000 });
1001 _ut.test('test_add_negative', () {
1002 final __test = new NodeListTest();
1003 runJUnitTest(__test, __test.test_add_negative);
1004 });
1005 _ut.test('test_add_tooBig', () {
1006 final __test = new NodeListTest();
1007 runJUnitTest(__test, __test.test_add_tooBig);
1008 });
1009 _ut.test('test_create', () {
1010 final __test = new NodeListTest();
1011 runJUnitTest(__test, __test.test_create);
1012 });
1013 _ut.test('test_creation', () {
1014 final __test = new NodeListTest();
1015 runJUnitTest(__test, __test.test_creation);
1016 });
1017 _ut.test('test_getBeginToken_empty', () {
1018 final __test = new NodeListTest();
1019 runJUnitTest(__test, __test.test_getBeginToken_empty);
1020 });
1021 _ut.test('test_getBeginToken_nonEmpty', () {
1022 final __test = new NodeListTest();
1023 runJUnitTest(__test, __test.test_getBeginToken_nonEmpty);
1024 });
1025 _ut.test('test_getEndToken_empty', () {
1026 final __test = new NodeListTest();
1027 runJUnitTest(__test, __test.test_getEndToken_empty);
1028 });
1029 _ut.test('test_getEndToken_nonEmpty', () {
1030 final __test = new NodeListTest();
1031 runJUnitTest(__test, __test.test_getEndToken_nonEmpty);
1032 });
1033 _ut.test('test_get_negative', () {
1034 final __test = new NodeListTest();
1035 runJUnitTest(__test, __test.test_get_negative);
1036 });
1037 _ut.test('test_get_tooBig', () {
1038 final __test = new NodeListTest();
1039 runJUnitTest(__test, __test.test_get_tooBig);
1040 });
1041 _ut.test('test_remove', () {
1042 final __test = new NodeListTest();
1043 runJUnitTest(__test, __test.test_remove);
1044 });
1045 _ut.test('test_remove_negative', () {
1046 final __test = new NodeListTest();
1047 runJUnitTest(__test, __test.test_remove_negative);
1048 });
1049 _ut.test('test_remove_tooBig', () {
1050 final __test = new NodeListTest();
1051 runJUnitTest(__test, __test.test_remove_tooBig);
1052 });
1053 _ut.test('test_set', () {
1054 final __test = new NodeListTest();
1055 runJUnitTest(__test, __test.test_set);
1056 });
1057 _ut.test('test_set_negative', () {
1058 final __test = new NodeListTest();
1059 runJUnitTest(__test, __test.test_set_negative);
1060 });
1061 _ut.test('test_set_tooBig', () {
1062 final __test = new NodeListTest();
1063 runJUnitTest(__test, __test.test_set_tooBig);
1064 });
1065 });
1066 }
1067 }
804 class ConstantEvaluatorTest extends ParserTestCase { 1068 class ConstantEvaluatorTest extends ParserTestCase {
805 void fail_constructor() { 1069 void fail_constructor() {
806 Object value = getConstantValue("?"); 1070 Object value = getConstantValue("?");
807 JUnitTestCase.assertEquals(null, value); 1071 JUnitTestCase.assertEquals(null, value);
808 } 1072 }
809 void fail_identifier_class() { 1073 void fail_identifier_class() {
810 Object value = getConstantValue("?"); 1074 Object value = getConstantValue("?");
811 JUnitTestCase.assertEquals(null, value); 1075 JUnitTestCase.assertEquals(null, value);
812 } 1076 }
813 void fail_identifier_function() { 1077 void fail_identifier_function() {
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 void test_visitClassDeclaration_parameters_extends_with_implements() { 1641 void test_visitClassDeclaration_parameters_extends_with_implements() {
1378 assertSource("class C<E> extends A with M implements B {}", ASTFactory.class Declaration(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsCl ause(ASTFactory.typeName4("A", [])), ASTFactory.withClause([ASTFactory.typeName4 ("M", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("B", [])]), [])); 1642 assertSource("class C<E> extends A with M implements B {}", ASTFactory.class Declaration(null, "C", ASTFactory.typeParameterList(["E"]), ASTFactory.extendsCl ause(ASTFactory.typeName4("A", [])), ASTFactory.withClause([ASTFactory.typeName4 ("M", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("B", [])]), []));
1379 } 1643 }
1380 void test_visitClassDeclaration_parameters_implements() { 1644 void test_visitClassDeclaration_parameters_implements() {
1381 assertSource("class C<E> implements B {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), null, null, ASTFactory.implementsClau se([ASTFactory.typeName4("B", [])]), [])); 1645 assertSource("class C<E> implements B {}", ASTFactory.classDeclaration(null, "C", ASTFactory.typeParameterList(["E"]), null, null, ASTFactory.implementsClau se([ASTFactory.typeName4("B", [])]), []));
1382 } 1646 }
1383 void test_visitClassDeclaration_singleMember() { 1647 void test_visitClassDeclaration_singleMember() {
1384 assertSource("class C {var a;}", ASTFactory.classDeclaration(null, "C", null , null, null, null, [ASTFactory.fieldDeclaration2(false, Keyword.VAR, [ASTFactor y.variableDeclaration("a")])])); 1648 assertSource("class C {var a;}", ASTFactory.classDeclaration(null, "C", null , null, null, null, [ASTFactory.fieldDeclaration2(false, Keyword.VAR, [ASTFactor y.variableDeclaration("a")])]));
1385 } 1649 }
1386 void test_visitClassTypeAlias_abstract() { 1650 void test_visitClassTypeAlias_abstract() {
1387 assertSource("typedef C = abstract S with M1;", ASTFactory.classTypeAlias("C ", null, Keyword.ABSTRACT, ASTFactory.typeName4("S", []), ASTFactory.withClause( [ASTFactory.typeName4("M1", [])]), null)); 1651 assertSource("class C = abstract S with M1;", ASTFactory.classTypeAlias("C", null, Keyword.ABSTRACT, ASTFactory.typeName4("S", []), ASTFactory.withClause([A STFactory.typeName4("M1", [])]), null));
1388 } 1652 }
1389 void test_visitClassTypeAlias_abstract_implements() { 1653 void test_visitClassTypeAlias_abstract_implements() {
1390 assertSource("typedef C = abstract S with M1 implements I;", ASTFactory.clas sTypeAlias("C", null, Keyword.ABSTRACT, ASTFactory.typeName4("S", []), ASTFactor y.withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implementsClause([AST Factory.typeName4("I", [])]))); 1654 assertSource("class C = abstract S with M1 implements I;", ASTFactory.classT ypeAlias("C", null, Keyword.ABSTRACT, ASTFactory.typeName4("S", []), ASTFactory. withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implementsClause([ASTFa ctory.typeName4("I", [])])));
1391 } 1655 }
1392 void test_visitClassTypeAlias_generic() { 1656 void test_visitClassTypeAlias_generic() {
1393 assertSource("typedef C<E> = S<E> with M1<E>;", ASTFactory.classTypeAlias("C ", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName4("S", [ASTFact ory.typeName4("E", [])]), ASTFactory.withClause([ASTFactory.typeName4("M1", [AST Factory.typeName4("E", [])])]), null)); 1657 assertSource("class C<E> = S<E> with M1<E>;", ASTFactory.classTypeAlias("C", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName4("S", [ASTFactor y.typeName4("E", [])]), ASTFactory.withClause([ASTFactory.typeName4("M1", [ASTFa ctory.typeName4("E", [])])]), null));
1394 } 1658 }
1395 void test_visitClassTypeAlias_implements() { 1659 void test_visitClassTypeAlias_implements() {
1396 assertSource("typedef C = S with M1 implements I;", ASTFactory.classTypeAlia s("C", null, null, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFact ory.typeName4("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("I" , [])]))); 1660 assertSource("class C = S with M1 implements I;", ASTFactory.classTypeAlias( "C", null, null, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFactor y.typeName4("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("I", [])])));
1397 } 1661 }
1398 void test_visitClassTypeAlias_minimal() { 1662 void test_visitClassTypeAlias_minimal() {
1399 assertSource("typedef C = S with M1;", ASTFactory.classTypeAlias("C", null, null, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4 ("M1", [])]), null)); 1663 assertSource("class C = S with M1;", ASTFactory.classTypeAlias("C", null, nu ll, ASTFactory.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4(" M1", [])]), null));
1400 } 1664 }
1401 void test_visitClassTypeAlias_parameters_abstract() { 1665 void test_visitClassTypeAlias_parameters_abstract() {
1402 assertSource("typedef C<E> = abstract S with M1;", ASTFactory.classTypeAlias ("C", ASTFactory.typeParameterList(["E"]), Keyword.ABSTRACT, ASTFactory.typeName 4("S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), null)); 1666 assertSource("class C<E> = abstract S with M1;", ASTFactory.classTypeAlias(" C", ASTFactory.typeParameterList(["E"]), Keyword.ABSTRACT, ASTFactory.typeName4( "S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), null));
1403 } 1667 }
1404 void test_visitClassTypeAlias_parameters_abstract_implements() { 1668 void test_visitClassTypeAlias_parameters_abstract_implements() {
1405 assertSource("typedef C<E> = abstract S with M1 implements I;", ASTFactory.c lassTypeAlias("C", ASTFactory.typeParameterList(["E"]), Keyword.ABSTRACT, ASTFac tory.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]) , ASTFactory.implementsClause([ASTFactory.typeName4("I", [])]))); 1669 assertSource("class C<E> = abstract S with M1 implements I;", ASTFactory.cla ssTypeAlias("C", ASTFactory.typeParameterList(["E"]), Keyword.ABSTRACT, ASTFacto ry.typeName4("S", []), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implementsClause([ASTFactory.typeName4("I", [])])));
1406 } 1670 }
1407 void test_visitClassTypeAlias_parameters_implements() { 1671 void test_visitClassTypeAlias_parameters_implements() {
1408 assertSource("typedef C<E> = S with M1 implements I;", ASTFactory.classTypeA lias("C", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName4("S", [ ]), ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implemen tsClause([ASTFactory.typeName4("I", [])]))); 1672 assertSource("class C<E> = S with M1 implements I;", ASTFactory.classTypeAli as("C", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName4("S", []) , ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implements Clause([ASTFactory.typeName4("I", [])])));
1409 } 1673 }
1410 void test_visitComment() { 1674 void test_visitComment() {
1411 assertSource("", Comment.createBlockComment(<Token> [TokenFactory.token2("/* comment */")])); 1675 assertSource("", Comment.createBlockComment(<Token> [TokenFactory.token2("/* comment */")]));
1412 } 1676 }
1413 void test_visitCommentReference() { 1677 void test_visitCommentReference() {
1414 assertSource("", new CommentReference.full(null, ASTFactory.identifier3("a") )); 1678 assertSource("", new CommentReference.full(null, ASTFactory.identifier3("a") ));
1415 } 1679 }
1416 void test_visitCompilationUnit_declaration() { 1680 void test_visitCompilationUnit_declaration() {
1417 assertSource("var a;", ASTFactory.compilationUnit2([ASTFactory.topLevelVaria bleDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")])])); 1681 assertSource("var a;", ASTFactory.compilationUnit2([ASTFactory.topLevelVaria bleDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")])]));
1418 } 1682 }
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after
3094 }); 3358 });
3095 }); 3359 });
3096 } 3360 }
3097 } 3361 }
3098 main() { 3362 main() {
3099 ConstantEvaluatorTest.dartSuite(); 3363 ConstantEvaluatorTest.dartSuite();
3100 NodeLocatorTest.dartSuite(); 3364 NodeLocatorTest.dartSuite();
3101 ToSourceVisitorTest.dartSuite(); 3365 ToSourceVisitorTest.dartSuite();
3102 BreadthFirstVisitorTest.dartSuite(); 3366 BreadthFirstVisitorTest.dartSuite();
3103 IndexExpressionTest.dartSuite(); 3367 IndexExpressionTest.dartSuite();
3368 NodeListTest.dartSuite();
3104 SimpleIdentifierTest.dartSuite(); 3369 SimpleIdentifierTest.dartSuite();
3105 VariableDeclarationTest.dartSuite(); 3370 VariableDeclarationTest.dartSuite();
3106 } 3371 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/scanner.dart ('k') | pkg/analyzer_experimental/test/generated/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698