OLD | NEW |
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_reflective_loader/test_reflective_loader.dart'; |
9 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
10 | 11 |
11 import '../../generated/parser_test.dart' show ParserTestCase; | 12 import '../../generated/parser_test.dart' show ParserTestCase; |
12 import '../../generated/test_support.dart'; | 13 import '../../generated/test_support.dart'; |
13 import '../../reflective_tests.dart'; | |
14 import '../../utils.dart'; | 14 import '../../utils.dart'; |
15 | 15 |
16 main() { | 16 main() { |
17 initializeTestEnvironment(); | 17 initializeTestEnvironment(); |
18 runReflectiveTests(BreadthFirstVisitorTest); | 18 defineReflectiveTests(BreadthFirstVisitorTest); |
19 } | 19 } |
20 | 20 |
21 @reflectiveTest | 21 @reflectiveTest |
22 class BreadthFirstVisitorTest extends ParserTestCase { | 22 class BreadthFirstVisitorTest extends ParserTestCase { |
23 void test_it() { | 23 void test_it() { |
24 String source = r''' | 24 String source = r''' |
25 class A { | 25 class A { |
26 bool get g => true; | 26 bool get g => true; |
27 } | 27 } |
28 class B { | 28 class B { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |