Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: pkg/analyzer/test/generated/error_suppression_test.dart

Issue 2627293002: Split "_Driver" tests to separate test files. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 import 'package:analyzer/src/error/codes.dart'; 5 import 'package:analyzer/src/error/codes.dart';
6 import 'package:analyzer/src/generated/source.dart'; 6 import 'package:analyzer/src/generated/source.dart';
7 import 'package:analyzer/src/generated/source_io.dart'; 7 import 'package:analyzer/src/generated/source_io.dart';
8 import 'package:test_reflective_loader/test_reflective_loader.dart'; 8 import 'package:test_reflective_loader/test_reflective_loader.dart';
9 9
10 import 'resolver_test_case.dart'; 10 import 'resolver_test_case.dart';
11 11
12 main() { 12 main() {
13 defineReflectiveSuite(() { 13 defineReflectiveSuite(() {
14 defineReflectiveTests(ErrorSuppressionTest); 14 defineReflectiveTests(ErrorSuppressionTest);
15 defineReflectiveTests(ErrorSuppressionTest_Driver);
16 }); 15 });
17 } 16 }
18 17
19 @reflectiveTest 18 @reflectiveTest
20 class ErrorSuppressionTest extends ResolverTestCase { 19 class ErrorSuppressionTest extends ResolverTestCase {
21 test_error_code_mismatch() async { 20 test_error_code_mismatch() async {
22 Source source = addSource(''' 21 Source source = addSource('''
23 // ignore: const_initialized_with_non_constant_value 22 // ignore: const_initialized_with_non_constant_value
24 int x = ''; 23 int x = '';
25 const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE 24 const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 int x = ''; //INVALID_ASSIGNMENT 189 int x = ''; //INVALID_ASSIGNMENT
191 const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE 190 const y = x; //CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
192 '''); 191 ''');
193 await computeAnalysisResult(source); 192 await computeAnalysisResult(source);
194 assertErrors(source, [ 193 assertErrors(source, [
195 StaticTypeWarningCode.INVALID_ASSIGNMENT, 194 StaticTypeWarningCode.INVALID_ASSIGNMENT,
196 CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE 195 CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
197 ]); 196 ]);
198 } 197 }
199 } 198 }
200
201 @reflectiveTest
202 class ErrorSuppressionTest_Driver extends ErrorSuppressionTest {
203 @override
204 bool get enableNewAnalysisDriver => true;
205 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698