OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.constant_test; | 5 library analyzer.test.constant_test; |
6 | 6 |
7 import 'package:analyzer/context/declared_variables.dart'; | 7 import 'package:analyzer/context/declared_variables.dart'; |
8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
9 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
11 import 'package:analyzer/src/dart/element/element.dart'; | 11 import 'package:analyzer/src/dart/element/element.dart'; |
12 import 'package:analyzer/src/generated/constant.dart'; | 12 import 'package:analyzer/src/generated/constant.dart'; |
13 import 'package:analyzer/src/generated/engine.dart'; | 13 import 'package:analyzer/src/generated/engine.dart'; |
14 import 'package:analyzer/src/generated/error.dart'; | 14 import 'package:analyzer/src/generated/error.dart'; |
15 import 'package:analyzer/src/generated/resolver.dart'; | 15 import 'package:analyzer/src/generated/resolver.dart'; |
16 import 'package:analyzer/src/generated/source.dart'; | 16 import 'package:analyzer/src/generated/source.dart'; |
17 import 'package:analyzer/src/generated/source_io.dart'; | 17 import 'package:analyzer/src/generated/source_io.dart'; |
18 import 'package:analyzer/src/generated/testing/ast_factory.dart'; | 18 import 'package:analyzer/src/generated/testing/ast_factory.dart'; |
19 import 'package:analyzer/src/generated/testing/test_type_provider.dart'; | 19 import 'package:analyzer/src/generated/testing/test_type_provider.dart'; |
20 import 'package:analyzer/src/task/dart.dart'; | 20 import 'package:analyzer/src/task/dart.dart'; |
21 import 'package:path/path.dart'; | 21 import 'package:path/path.dart'; |
| 22 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
22 import 'package:unittest/unittest.dart'; | 23 import 'package:unittest/unittest.dart'; |
23 | 24 |
24 import '../../../generated/resolver_test_case.dart'; | 25 import '../../../generated/resolver_test_case.dart'; |
25 import '../../../generated/test_support.dart'; | 26 import '../../../generated/test_support.dart'; |
26 import '../../../reflective_tests.dart'; | |
27 import '../../../utils.dart'; | 27 import '../../../utils.dart'; |
28 | 28 |
29 main() { | 29 main() { |
30 initializeTestEnvironment(); | 30 initializeTestEnvironment(); |
31 runReflectiveTests(ConstantValueComputerTest); | 31 defineReflectiveTests(ConstantValueComputerTest); |
32 runReflectiveTests(ConstantVisitorTest); | 32 defineReflectiveTests(ConstantVisitorTest); |
33 runReflectiveTests(StrongConstantValueComputerTest); | 33 defineReflectiveTests(StrongConstantValueComputerTest); |
34 } | 34 } |
35 | 35 |
36 /** | 36 /** |
37 * Implementation of [ConstantEvaluationValidator] used during unit tests; | 37 * Implementation of [ConstantEvaluationValidator] used during unit tests; |
38 * verifies that any nodes referenced during constant evaluation are present in | 38 * verifies that any nodes referenced during constant evaluation are present in |
39 * the dependency graph. | 39 * the dependency graph. |
40 */ | 40 */ |
41 class ConstantEvaluationValidator_ForTest | 41 class ConstantEvaluationValidator_ForTest |
42 implements ConstantEvaluationValidator { | 42 implements ConstantEvaluationValidator { |
43 final InternalAnalysisContext context; | 43 final InternalAnalysisContext context; |
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1602 } | 1602 } |
1603 } | 1603 } |
1604 | 1604 |
1605 @reflectiveTest | 1605 @reflectiveTest |
1606 class StrongConstantValueComputerTest extends ConstantValueComputerTest { | 1606 class StrongConstantValueComputerTest extends ConstantValueComputerTest { |
1607 void setUp() { | 1607 void setUp() { |
1608 super.setUp(); | 1608 super.setUp(); |
1609 resetWithOptions(new AnalysisOptionsImpl()..strongMode = true); | 1609 resetWithOptions(new AnalysisOptionsImpl()..strongMode = true); |
1610 } | 1610 } |
1611 } | 1611 } |
OLD | NEW |