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

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: 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 4369 matching lines...) Expand 10 before | Expand all | Expand 10 after
4380 class C { 4380 class C {
4381 String field = topLevel; 4381 String field = topLevel;
4382 } 4382 }
4383 '''); 4383 ''');
4384 computeResult(new LibrarySpecificUnit(source, source), STRONG_MODE_ERRORS); 4384 computeResult(new LibrarySpecificUnit(source, source), STRONG_MODE_ERRORS);
4385 // validate 4385 // validate
4386 _fillErrorListener(STRONG_MODE_ERRORS); 4386 _fillErrorListener(STRONG_MODE_ERRORS);
4387 4387
4388 var errors = errorListener.errors; 4388 var errors = errorListener.errors;
4389 expect(errors.length, 1); 4389 expect(errors.length, 1);
4390 expect(errors[0].errorCode.name, "dev_compiler.StaticTypeError"); 4390 expect(errors[0].errorCode.name, "STRONG_MODE_STATIC_TYPE_ERROR");
4391 } 4391 }
4392 } 4392 }
4393 4393
4394 @reflectiveTest 4394 @reflectiveTest
4395 class VerifyUnitTaskTest extends _AbstractDartTaskTest { 4395 class VerifyUnitTaskTest extends _AbstractDartTaskTest {
4396 test_perform_constantError() { 4396 test_perform_constantError() {
4397 Source source = newSource( 4397 Source source = newSource(
4398 '/test.dart', 4398 '/test.dart',
4399 ''' 4399 '''
4400 main(int p) { 4400 main(int p) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
4585 /** 4585 /**
4586 * Fill [errorListener] with [result] errors in the current [task]. 4586 * Fill [errorListener] with [result] errors in the current [task].
4587 */ 4587 */
4588 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { 4588 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) {
4589 List<AnalysisError> errors = task.outputs[result]; 4589 List<AnalysisError> errors = task.outputs[result];
4590 expect(errors, isNotNull, reason: result.name); 4590 expect(errors, isNotNull, reason: result.name);
4591 errorListener = new GatheringErrorListener(); 4591 errorListener = new GatheringErrorListener();
4592 errorListener.addAll(errors); 4592 errorListener.addAll(errors);
4593 } 4593 }
4594 } 4594 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698