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

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

Issue 103233003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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
« no previous file with comments | « pkg/analyzer/pubspec.yaml ('k') | pkg/analyzer/test/generated/element_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 "}", 1004 "}",
1005 "A f(var p) {", 1005 "A f(var p) {",
1006 " if ((p as A).g) {", 1006 " if ((p as A).g) {",
1007 " return p;", 1007 " return p;",
1008 " } else {", 1008 " } else {",
1009 " return null;", 1009 " return null;",
1010 " }", 1010 " }",
1011 "}"]); 1011 "}"]);
1012 CompilationUnit unit = ParserTestCase.parseCompilationUnit(source, []); 1012 CompilationUnit unit = ParserTestCase.parseCompilationUnit(source, []);
1013 List<ASTNode> nodes = new List<ASTNode>(); 1013 List<ASTNode> nodes = new List<ASTNode>();
1014 BreadthFirstVisitor<Object> visitor = new BreadthFirstVisitor_19(nodes); 1014 BreadthFirstVisitor<Object> visitor = new BreadthFirstVisitor_20(nodes);
1015 visitor.visitAllNodes(unit); 1015 visitor.visitAllNodes(unit);
1016 EngineTestCase.assertSize(59, nodes); 1016 EngineTestCase.assertSize(59, nodes);
1017 EngineTestCase.assertInstanceOf(CompilationUnit, nodes[0]); 1017 EngineTestCase.assertInstanceOf(CompilationUnit, nodes[0]);
1018 EngineTestCase.assertInstanceOf(ClassDeclaration, nodes[2]); 1018 EngineTestCase.assertInstanceOf(ClassDeclaration, nodes[2]);
1019 EngineTestCase.assertInstanceOf(FunctionDeclaration, nodes[3]); 1019 EngineTestCase.assertInstanceOf(FunctionDeclaration, nodes[3]);
1020 EngineTestCase.assertInstanceOf(FunctionDeclarationStatement, nodes[27]); 1020 EngineTestCase.assertInstanceOf(FunctionDeclarationStatement, nodes[27]);
1021 EngineTestCase.assertInstanceOf(IntegerLiteral, nodes[58]); 1021 EngineTestCase.assertInstanceOf(IntegerLiteral, nodes[58]);
1022 } 1022 }
1023 1023
1024 static dartSuite() { 1024 static dartSuite() {
1025 _ut.group('BreadthFirstVisitorTest', () { 1025 _ut.group('BreadthFirstVisitorTest', () {
1026 _ut.test('testIt', () { 1026 _ut.test('testIt', () {
1027 final __test = new BreadthFirstVisitorTest(); 1027 final __test = new BreadthFirstVisitorTest();
1028 runJUnitTest(__test, __test.testIt); 1028 runJUnitTest(__test, __test.testIt);
1029 }); 1029 });
1030 }); 1030 });
1031 } 1031 }
1032 } 1032 }
1033 1033
1034 class BreadthFirstVisitor_19 extends BreadthFirstVisitor<Object> { 1034 class BreadthFirstVisitor_20 extends BreadthFirstVisitor<Object> {
1035 List<ASTNode> nodes; 1035 List<ASTNode> nodes;
1036 1036
1037 BreadthFirstVisitor_19(this.nodes) : super(); 1037 BreadthFirstVisitor_20(this.nodes) : super();
1038 1038
1039 Object visitNode(ASTNode node) { 1039 Object visitNode(ASTNode node) {
1040 nodes.add(node); 1040 nodes.add(node);
1041 return super.visitNode(node); 1041 return super.visitNode(node);
1042 } 1042 }
1043 } 1043 }
1044 1044
1045 class NodeListTest extends EngineTestCase { 1045 class NodeListTest extends EngineTestCase {
1046 void test_add() { 1046 void test_add() {
1047 ASTNode parent = ASTFactory.argumentList([]); 1047 ASTNode parent = ASTFactory.argumentList([]);
(...skipping 2903 matching lines...) Expand 10 before | Expand all | Expand 10 after
3951 main() { 3951 main() {
3952 ConstantEvaluatorTest.dartSuite(); 3952 ConstantEvaluatorTest.dartSuite();
3953 NodeLocatorTest.dartSuite(); 3953 NodeLocatorTest.dartSuite();
3954 ToSourceVisitorTest.dartSuite(); 3954 ToSourceVisitorTest.dartSuite();
3955 BreadthFirstVisitorTest.dartSuite(); 3955 BreadthFirstVisitorTest.dartSuite();
3956 IndexExpressionTest.dartSuite(); 3956 IndexExpressionTest.dartSuite();
3957 NodeListTest.dartSuite(); 3957 NodeListTest.dartSuite();
3958 SimpleIdentifierTest.dartSuite(); 3958 SimpleIdentifierTest.dartSuite();
3959 VariableDeclarationTest.dartSuite(); 3959 VariableDeclarationTest.dartSuite();
3960 } 3960 }
OLDNEW
« no previous file with comments | « pkg/analyzer/pubspec.yaml ('k') | pkg/analyzer/test/generated/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698