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

Side by Side Diff: pkg/analyzer/test/dart/ast/visitor_test.dart

Issue 2683543006: Make some parser test helper methods non-static. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | pkg/analyzer/test/dart/element/builder_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 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.dart.ast.visitor_test; 5 library analyzer.test.dart.ast.visitor_test;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/visitor.dart'; 8 import 'package:analyzer/dart/ast/visitor.dart';
9 import 'package:test/test.dart'; 9 import 'package:test/test.dart';
10 import 'package:test_reflective_loader/test_reflective_loader.dart'; 10 import 'package:test_reflective_loader/test_reflective_loader.dart';
(...skipping 22 matching lines...) Expand all
33 return q() + 4; 33 return q() + 4;
34 } 34 }
35 } 35 }
36 A f(var p) { 36 A f(var p) {
37 if ((p as A).g) { 37 if ((p as A).g) {
38 return p; 38 return p;
39 } else { 39 } else {
40 return null; 40 return null;
41 } 41 }
42 }'''; 42 }''';
43 CompilationUnit unit = ParserTestCase.parseCompilationUnit(source); 43 CompilationUnit unit = parseCompilationUnit(source);
44 List<AstNode> nodes = new List<AstNode>(); 44 List<AstNode> nodes = new List<AstNode>();
45 BreadthFirstVisitor<Object> visitor = 45 BreadthFirstVisitor<Object> visitor =
46 new _BreadthFirstVisitorTestHelper(nodes); 46 new _BreadthFirstVisitorTestHelper(nodes);
47 visitor.visitAllNodes(unit); 47 visitor.visitAllNodes(unit);
48 expect(nodes, hasLength(59)); 48 expect(nodes, hasLength(59));
49 EngineTestCase.assertInstanceOf( 49 EngineTestCase.assertInstanceOf(
50 (obj) => obj is CompilationUnit, CompilationUnit, nodes[0]); 50 (obj) => obj is CompilationUnit, CompilationUnit, nodes[0]);
51 EngineTestCase.assertInstanceOf( 51 EngineTestCase.assertInstanceOf(
52 (obj) => obj is ClassDeclaration, ClassDeclaration, nodes[2]); 52 (obj) => obj is ClassDeclaration, ClassDeclaration, nodes[2]);
53 EngineTestCase.assertInstanceOf( 53 EngineTestCase.assertInstanceOf(
(...skipping 16 matching lines...) Expand all
70 List<AstNode> nodes; 70 List<AstNode> nodes;
71 71
72 _BreadthFirstVisitorTestHelper(this.nodes) : super(); 72 _BreadthFirstVisitorTestHelper(this.nodes) : super();
73 73
74 @override 74 @override
75 Object visitNode(AstNode node) { 75 Object visitNode(AstNode node) {
76 nodes.add(node); 76 nodes.add(node);
77 return super.visitNode(node); 77 return super.visitNode(node);
78 } 78 }
79 } 79 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/dart/element/builder_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698