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

Side by Side Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1497253002: Align strong-mode error codes with analyzer conv. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: doc_fix Created 5 years 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) 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 library test.src.task.dart_test; 5 library test.src.task.dart_test;
6 6
7 import 'package:analyzer/src/context/cache.dart'; 7 import 'package:analyzer/src/context/cache.dart';
8 import 'package:analyzer/src/generated/ast.dart'; 8 import 'package:analyzer/src/generated/ast.dart';
9 import 'package:analyzer/src/generated/constant.dart'; 9 import 'package:analyzer/src/generated/constant.dart';
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
(...skipping 4376 matching lines...) Expand 10 before | Expand all | Expand 10 after
4387 class C { 4387 class C {
4388 String field = topLevel; 4388 String field = topLevel;
4389 } 4389 }
4390 '''); 4390 ''');
4391 computeResult(new LibrarySpecificUnit(source, source), STRONG_MODE_ERRORS); 4391 computeResult(new LibrarySpecificUnit(source, source), STRONG_MODE_ERRORS);
4392 // validate 4392 // validate
4393 _fillErrorListener(STRONG_MODE_ERRORS); 4393 _fillErrorListener(STRONG_MODE_ERRORS);
4394 4394
4395 var errors = errorListener.errors; 4395 var errors = errorListener.errors;
4396 expect(errors.length, 1); 4396 expect(errors.length, 1);
4397 expect(errors[0].errorCode.name, "dev_compiler.StaticTypeError"); 4397 expect(errors[0].errorCode.name, "STRONG_MODE_STATIC_TYPE_ERROR");
4398 } 4398 }
4399 } 4399 }
4400 4400
4401 @reflectiveTest 4401 @reflectiveTest
4402 class VerifyUnitTaskTest extends _AbstractDartTaskTest { 4402 class VerifyUnitTaskTest extends _AbstractDartTaskTest {
4403 test_perform_constantError() { 4403 test_perform_constantError() {
4404 Source source = newSource( 4404 Source source = newSource(
4405 '/test.dart', 4405 '/test.dart',
4406 ''' 4406 '''
4407 main(int p) { 4407 main(int p) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
4592 /** 4592 /**
4593 * Fill [errorListener] with [result] errors in the current [task]. 4593 * Fill [errorListener] with [result] errors in the current [task].
4594 */ 4594 */
4595 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { 4595 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) {
4596 List<AnalysisError> errors = task.outputs[result]; 4596 List<AnalysisError> errors = task.outputs[result];
4597 expect(errors, isNotNull, reason: result.name); 4597 expect(errors, isNotNull, reason: result.name);
4598 errorListener = new GatheringErrorListener(); 4598 errorListener = new GatheringErrorListener();
4599 errorListener.addAll(errors); 4599 errorListener.addAll(errors);
4600 } 4600 }
4601 } 4601 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698