| 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/error/error.dart'; | 11 import 'package:analyzer/error/error.dart'; |
| 12 import 'package:analyzer/error/listener.dart'; | 12 import 'package:analyzer/error/listener.dart'; |
| 13 import 'package:analyzer/src/dart/element/element.dart'; | 13 import 'package:analyzer/src/dart/element/element.dart'; |
| 14 import 'package:analyzer/src/error/codes.dart'; | 14 import 'package:analyzer/src/error/codes.dart'; |
| 15 import 'package:analyzer/src/generated/constant.dart'; | 15 import 'package:analyzer/src/generated/constant.dart'; |
| 16 import 'package:analyzer/src/generated/engine.dart'; | 16 import 'package:analyzer/src/generated/engine.dart'; |
| 17 import 'package:analyzer/src/generated/resolver.dart'; | 17 import 'package:analyzer/src/generated/resolver.dart'; |
| 18 import 'package:analyzer/src/generated/source.dart'; | 18 import 'package:analyzer/src/generated/source.dart'; |
| 19 import 'package:analyzer/src/generated/source_io.dart'; | 19 import 'package:analyzer/src/generated/source_io.dart'; |
| 20 import 'package:analyzer/src/generated/testing/ast_factory.dart'; | 20 import 'package:analyzer/src/generated/testing/ast_factory.dart'; |
| 21 import 'package:analyzer/src/generated/testing/test_type_provider.dart'; | 21 import 'package:analyzer/src/generated/testing/test_type_provider.dart'; |
| 22 import 'package:analyzer/src/task/dart.dart'; | 22 import 'package:analyzer/src/task/dart.dart'; |
| 23 import 'package:path/path.dart'; | 23 import 'package:path/path.dart'; |
| 24 import 'package:test/test.dart'; |
| 24 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 25 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 25 import 'package:unittest/unittest.dart'; | |
| 26 | 26 |
| 27 import '../../../generated/resolver_test_case.dart'; | 27 import '../../../generated/resolver_test_case.dart'; |
| 28 import '../../../generated/test_support.dart'; | 28 import '../../../generated/test_support.dart'; |
| 29 import '../../../utils.dart'; | 29 import '../../../utils.dart'; |
| 30 | 30 |
| 31 main() { | 31 main() { |
| 32 initializeTestEnvironment(); | 32 initializeTestEnvironment(); |
| 33 defineReflectiveTests(ConstantValueComputerTest); | 33 defineReflectiveSuite(() { |
| 34 defineReflectiveTests(ConstantVisitorTest); | 34 defineReflectiveTests(ConstantValueComputerTest); |
| 35 defineReflectiveTests(StrongConstantValueComputerTest); | 35 defineReflectiveTests(ConstantVisitorTest); |
| 36 defineReflectiveTests(StrongConstantValueComputerTest); |
| 37 }); |
| 36 } | 38 } |
| 37 | 39 |
| 38 /** | 40 /** |
| 39 * Implementation of [ConstantEvaluationValidator] used during unit tests; | 41 * Implementation of [ConstantEvaluationValidator] used during unit tests; |
| 40 * verifies that any nodes referenced during constant evaluation are present in | 42 * verifies that any nodes referenced during constant evaluation are present in |
| 41 * the dependency graph. | 43 * the dependency graph. |
| 42 */ | 44 */ |
| 43 class ConstantEvaluationValidator_ForTest | 45 class ConstantEvaluationValidator_ForTest |
| 44 implements ConstantEvaluationValidator { | 46 implements ConstantEvaluationValidator { |
| 45 final InternalAnalysisContext context; | 47 final InternalAnalysisContext context; |
| (...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 } | 1606 } |
| 1605 } | 1607 } |
| 1606 | 1608 |
| 1607 @reflectiveTest | 1609 @reflectiveTest |
| 1608 class StrongConstantValueComputerTest extends ConstantValueComputerTest { | 1610 class StrongConstantValueComputerTest extends ConstantValueComputerTest { |
| 1609 void setUp() { | 1611 void setUp() { |
| 1610 super.setUp(); | 1612 super.setUp(); |
| 1611 resetWithOptions(new AnalysisOptionsImpl()..strongMode = true); | 1613 resetWithOptions(new AnalysisOptionsImpl()..strongMode = true); |
| 1612 } | 1614 } |
| 1613 } | 1615 } |
| OLD | NEW |