| 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.ast_test; | 4 library engine.ast_test; |
| 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/scanner.dart'; | 8 import 'package:analyzer/src/generated/scanner.dart'; |
| 9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/utilities_dart.dart'; | 10 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| (...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 "}", | 1028 "}", |
| 1029 "A f(var p) {", | 1029 "A f(var p) {", |
| 1030 " if ((p as A).g) {", | 1030 " if ((p as A).g) {", |
| 1031 " return p;", | 1031 " return p;", |
| 1032 " } else {", | 1032 " } else {", |
| 1033 " return null;", | 1033 " return null;", |
| 1034 " }", | 1034 " }", |
| 1035 "}"]); | 1035 "}"]); |
| 1036 CompilationUnit unit = ParserTestCase.parseCompilationUnit(source, []); | 1036 CompilationUnit unit = ParserTestCase.parseCompilationUnit(source, []); |
| 1037 List<ASTNode> nodes = new List<ASTNode>(); | 1037 List<ASTNode> nodes = new List<ASTNode>(); |
| 1038 BreadthFirstVisitor<Object> visitor = new BreadthFirstVisitor_20(nodes); | 1038 BreadthFirstVisitor<Object> visitor = new BreadthFirstVisitor_21(nodes); |
| 1039 visitor.visitAllNodes(unit); | 1039 visitor.visitAllNodes(unit); |
| 1040 EngineTestCase.assertSize(59, nodes); | 1040 EngineTestCase.assertSize(59, nodes); |
| 1041 EngineTestCase.assertInstanceOf(CompilationUnit, nodes[0]); | 1041 EngineTestCase.assertInstanceOf(CompilationUnit, nodes[0]); |
| 1042 EngineTestCase.assertInstanceOf(ClassDeclaration, nodes[2]); | 1042 EngineTestCase.assertInstanceOf(ClassDeclaration, nodes[2]); |
| 1043 EngineTestCase.assertInstanceOf(FunctionDeclaration, nodes[3]); | 1043 EngineTestCase.assertInstanceOf(FunctionDeclaration, nodes[3]); |
| 1044 EngineTestCase.assertInstanceOf(FunctionDeclarationStatement, nodes[27]); | 1044 EngineTestCase.assertInstanceOf(FunctionDeclarationStatement, nodes[27]); |
| 1045 EngineTestCase.assertInstanceOf(IntegerLiteral, nodes[58]); | 1045 EngineTestCase.assertInstanceOf(IntegerLiteral, nodes[58]); |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 static dartSuite() { | 1048 static dartSuite() { |
| 1049 _ut.group('BreadthFirstVisitorTest', () { | 1049 _ut.group('BreadthFirstVisitorTest', () { |
| 1050 _ut.test('testIt', () { | 1050 _ut.test('testIt', () { |
| 1051 final __test = new BreadthFirstVisitorTest(); | 1051 final __test = new BreadthFirstVisitorTest(); |
| 1052 runJUnitTest(__test, __test.testIt); | 1052 runJUnitTest(__test, __test.testIt); |
| 1053 }); | 1053 }); |
| 1054 }); | 1054 }); |
| 1055 } | 1055 } |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 class BreadthFirstVisitor_20 extends BreadthFirstVisitor<Object> { | 1058 class BreadthFirstVisitor_21 extends BreadthFirstVisitor<Object> { |
| 1059 List<ASTNode> nodes; | 1059 List<ASTNode> nodes; |
| 1060 | 1060 |
| 1061 BreadthFirstVisitor_20(this.nodes) : super(); | 1061 BreadthFirstVisitor_21(this.nodes) : super(); |
| 1062 | 1062 |
| 1063 Object visitNode(ASTNode node) { | 1063 Object visitNode(ASTNode node) { |
| 1064 nodes.add(node); | 1064 nodes.add(node); |
| 1065 return super.visitNode(node); | 1065 return super.visitNode(node); |
| 1066 } | 1066 } |
| 1067 } | 1067 } |
| 1068 | 1068 |
| 1069 class NodeListTest extends EngineTestCase { | 1069 class NodeListTest extends EngineTestCase { |
| 1070 void test_add() { | 1070 void test_add() { |
| 1071 ASTNode parent = ASTFactory.argumentList([]); | 1071 ASTNode parent = ASTFactory.argumentList([]); |
| (...skipping 2904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3976 ConstantEvaluatorTest.dartSuite(); | 3976 ConstantEvaluatorTest.dartSuite(); |
| 3977 NodeLocatorTest.dartSuite(); | 3977 NodeLocatorTest.dartSuite(); |
| 3978 ToSourceVisitorTest.dartSuite(); | 3978 ToSourceVisitorTest.dartSuite(); |
| 3979 BreadthFirstVisitorTest.dartSuite(); | 3979 BreadthFirstVisitorTest.dartSuite(); |
| 3980 ClassDeclarationTest.dartSuite(); | 3980 ClassDeclarationTest.dartSuite(); |
| 3981 IndexExpressionTest.dartSuite(); | 3981 IndexExpressionTest.dartSuite(); |
| 3982 NodeListTest.dartSuite(); | 3982 NodeListTest.dartSuite(); |
| 3983 SimpleIdentifierTest.dartSuite(); | 3983 SimpleIdentifierTest.dartSuite(); |
| 3984 VariableDeclarationTest.dartSuite(); | 3984 VariableDeclarationTest.dartSuite(); |
| 3985 } | 3985 } |
| OLD | NEW |