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.generated.hint_code_test; | 5 library analyzer.test.generated.hint_code_test; |
6 | 6 |
7 import 'package:analyzer/error/error.dart'; | 7 import 'package:analyzer/error/error.dart'; |
8 import 'package:analyzer/src/error/codes.dart'; | 8 import 'package:analyzer/src/error/codes.dart'; |
9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
10 import 'package:analyzer/src/generated/parser.dart'; | 10 import 'package:analyzer/src/generated/parser.dart'; |
11 import 'package:analyzer/src/generated/source_io.dart'; | 11 import 'package:analyzer/src/generated/source_io.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 '../utils.dart'; | 15 import '../utils.dart'; |
16 import 'analysis_context_factory.dart'; | 16 import 'analysis_context_factory.dart'; |
17 import 'resolver_test_case.dart'; | 17 import 'resolver_test_case.dart'; |
18 | 18 |
19 main() { | 19 main() { |
20 initializeTestEnvironment(); | 20 initializeTestEnvironment(); |
21 defineReflectiveTests(HintCodeTest); | 21 defineReflectiveSuite(() { |
| 22 defineReflectiveTests(HintCodeTest); |
| 23 }); |
22 } | 24 } |
23 | 25 |
24 @reflectiveTest | 26 @reflectiveTest |
25 class HintCodeTest extends ResolverTestCase { | 27 class HintCodeTest extends ResolverTestCase { |
26 @override | 28 @override |
27 void reset() { | 29 void reset() { |
28 analysisContext2 = AnalysisContextFactory.contextWithCoreAndPackages({ | 30 analysisContext2 = AnalysisContextFactory.contextWithCoreAndPackages({ |
29 'package:meta/meta.dart': r''' | 31 'package:meta/meta.dart': r''' |
30 library meta; | 32 library meta; |
31 | 33 |
(...skipping 3980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4012 n() { | 4014 n() { |
4013 var a = m(), b = m(); | 4015 var a = m(), b = m(); |
4014 } | 4016 } |
4015 }'''); | 4017 }'''); |
4016 computeLibrarySourceErrors(source); | 4018 computeLibrarySourceErrors(source); |
4017 assertErrors( | 4019 assertErrors( |
4018 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]); | 4020 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]); |
4019 verify([source]); | 4021 verify([source]); |
4020 } | 4022 } |
4021 } | 4023 } |
OLD | NEW |