OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // TODO(jmesserly): this file needs to be refactored, it's a port from | 5 // TODO(jmesserly): this file needs to be refactored, it's a port from |
6 // package:dev_compiler's tests | 6 // package:dev_compiler's tests |
7 /// Tests for type inference. | 7 /// Tests for type inference. |
8 library analyzer.test.src.task.strong.inferred_type_test; | 8 library analyzer.test.src.task.strong.inferred_type_test; |
9 | 9 |
10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| 11 import 'package:test/test.dart'; |
11 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
12 import 'package:unittest/unittest.dart'; | |
13 | 13 |
14 import 'strong_test_helper.dart' as helper; | 14 import 'strong_test_helper.dart' as helper; |
15 | 15 |
16 void main() { | 16 void main() { |
17 helper.initStrongModeTests(); | 17 defineReflectiveSuite(() { |
18 defineReflectiveTests(InferredTypeTest); | 18 defineReflectiveTests(InferredTypeTest); |
| 19 }); |
19 } | 20 } |
20 | 21 |
21 abstract class InferredTypeMixin { | 22 abstract class InferredTypeMixin { |
22 /** | 23 /** |
23 * If `true` then types of local elements may be checked. | 24 * If `true` then types of local elements may be checked. |
24 */ | 25 */ |
25 bool get mayCheckTypesOfLocals; | 26 bool get mayCheckTypesOfLocals; |
26 | 27 |
27 /** | 28 /** |
28 * Add a new file with the given [name] and [content]. | 29 * Add a new file with the given [name] and [content]. |
(...skipping 4594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4623 helper.addFile(content, name: name); | 4624 helper.addFile(content, name: name); |
4624 } | 4625 } |
4625 | 4626 |
4626 /// Adds a file using [helper.addFile] and calls [helper.check]. | 4627 /// Adds a file using [helper.addFile] and calls [helper.check]. |
4627 /// | 4628 /// |
4628 /// Also returns the resolved compilation unit. | 4629 /// Also returns the resolved compilation unit. |
4629 @override | 4630 @override |
4630 CompilationUnitElement checkFile(String content) { | 4631 CompilationUnitElement checkFile(String content) { |
4631 return helper.checkFile(content).element; | 4632 return helper.checkFile(content).element; |
4632 } | 4633 } |
| 4634 |
| 4635 void setUp() { |
| 4636 helper.doSetUp(); |
| 4637 } |
| 4638 |
| 4639 void tearDown() { |
| 4640 helper.doTearDown(); |
| 4641 } |
4633 } | 4642 } |
OLD | NEW |