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.ast_test; | 5 library analyzer.test.dart.ast.ast_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/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
9 import 'package:analyzer/src/dart/ast/token.dart'; | 9 import 'package:analyzer/src/dart/ast/token.dart'; |
10 import 'package:analyzer/src/generated/testing/ast_factory.dart'; | 10 import 'package:analyzer/src/generated/testing/ast_factory.dart'; |
11 import 'package:analyzer/src/generated/testing/token_factory.dart'; | 11 import 'package:analyzer/src/generated/testing/token_factory.dart'; |
| 12 import 'package:test/test.dart'; |
12 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 13 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
13 import 'package:unittest/unittest.dart'; | |
14 | 14 |
15 import '../../generated/parser_test.dart' show ParserTestCase; | 15 import '../../generated/parser_test.dart' show ParserTestCase; |
16 import '../../generated/test_support.dart'; | 16 import '../../generated/test_support.dart'; |
17 import '../../utils.dart'; | 17 import '../../utils.dart'; |
18 | 18 |
19 main() { | 19 main() { |
20 initializeTestEnvironment(); | 20 initializeTestEnvironment(); |
21 defineReflectiveTests(ClassDeclarationTest); | 21 defineReflectiveSuite(() { |
22 defineReflectiveTests(ClassTypeAliasTest); | 22 defineReflectiveTests(ClassDeclarationTest); |
23 defineReflectiveTests(ConstructorDeclarationTest); | 23 defineReflectiveTests(ClassTypeAliasTest); |
24 defineReflectiveTests(FieldFormalParameterTest); | 24 defineReflectiveTests(ConstructorDeclarationTest); |
25 defineReflectiveTests(IndexExpressionTest); | 25 defineReflectiveTests(FieldFormalParameterTest); |
26 defineReflectiveTests(MethodDeclarationTest); | 26 defineReflectiveTests(IndexExpressionTest); |
27 defineReflectiveTests(NodeListTest); | 27 defineReflectiveTests(MethodDeclarationTest); |
28 defineReflectiveTests(SimpleIdentifierTest); | 28 defineReflectiveTests(NodeListTest); |
29 defineReflectiveTests(SimpleStringLiteralTest); | 29 defineReflectiveTests(SimpleIdentifierTest); |
30 defineReflectiveTests(StringInterpolationTest); | 30 defineReflectiveTests(SimpleStringLiteralTest); |
31 defineReflectiveTests(VariableDeclarationTest); | 31 defineReflectiveTests(StringInterpolationTest); |
| 32 defineReflectiveTests(VariableDeclarationTest); |
| 33 }); |
32 } | 34 } |
33 | 35 |
34 @reflectiveTest | 36 @reflectiveTest |
35 class ClassDeclarationTest extends ParserTestCase { | 37 class ClassDeclarationTest extends ParserTestCase { |
36 void test_getConstructor() { | 38 void test_getConstructor() { |
37 List<ConstructorInitializer> initializers = | 39 List<ConstructorInitializer> initializers = |
38 new List<ConstructorInitializer>(); | 40 new List<ConstructorInitializer>(); |
39 ConstructorDeclaration defaultConstructor = | 41 ConstructorDeclaration defaultConstructor = |
40 AstFactory.constructorDeclaration(AstFactory.identifier3("Test"), null, | 42 AstFactory.constructorDeclaration(AstFactory.identifier3("Test"), null, |
41 AstFactory.formalParameterList(), initializers); | 43 AstFactory.formalParameterList(), initializers); |
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 final int ordinal; | 1229 final int ordinal; |
1228 | 1230 |
1229 const _WrapperKind(this.name, this.ordinal); | 1231 const _WrapperKind(this.name, this.ordinal); |
1230 | 1232 |
1231 int get hashCode => ordinal; | 1233 int get hashCode => ordinal; |
1232 | 1234 |
1233 int compareTo(_WrapperKind other) => ordinal - other.ordinal; | 1235 int compareTo(_WrapperKind other) => ordinal - other.ordinal; |
1234 | 1236 |
1235 String toString() => name; | 1237 String toString() => name; |
1236 } | 1238 } |
OLD | NEW |