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

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

Issue 2290373003: Move error checking from scope creation to error reporter (take 2) (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 analyzer.test.src.task.dart_test; 5 library analyzer.test.src.task.dart_test;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/token.dart'; 8 import 'package:analyzer/dart/ast/token.dart';
9 import 'package:analyzer/dart/ast/visitor.dart'; 9 import 'package:analyzer/dart/ast/visitor.dart';
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 5319 matching lines...) Expand 10 before | Expand all | Expand 10 after
5330 } 5330 }
5331 5331
5332 main() { 5332 main() {
5333 const Test(); 5333 const Test();
5334 } 5334 }
5335 '''); 5335 ''');
5336 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source); 5336 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
5337 computeResult(target, VERIFY_ERRORS, matcher: isVerifyUnitTask); 5337 computeResult(target, VERIFY_ERRORS, matcher: isVerifyUnitTask);
5338 // validate 5338 // validate
5339 _fillErrorListener(VERIFY_ERRORS); 5339 _fillErrorListener(VERIFY_ERRORS);
5340 errorListener.assertNoErrors(); 5340 errorListener
5341 .assertErrorsWithCodes([CompileTimeErrorCode.DUPLICATE_DEFINITION]);
5341 } 5342 }
5342 5343
5343 test_perform_ConstantValidator_noInitializer() { 5344 test_perform_ConstantValidator_noInitializer() {
5344 Source source = newSource( 5345 Source source = newSource(
5345 '/test.dart', 5346 '/test.dart',
5346 ''' 5347 '''
5347 const x; 5348 const x;
5348 '''); 5349 ''');
5349 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source); 5350 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
5350 computeResult(target, VERIFY_ERRORS, matcher: isVerifyUnitTask); 5351 computeResult(target, VERIFY_ERRORS, matcher: isVerifyUnitTask);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
5541 /** 5542 /**
5542 * Fill [errorListener] with [result] errors in the current [task]. 5543 * Fill [errorListener] with [result] errors in the current [task].
5543 */ 5544 */
5544 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { 5545 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) {
5545 List<AnalysisError> errors = task.outputs[result] as List<AnalysisError>; 5546 List<AnalysisError> errors = task.outputs[result] as List<AnalysisError>;
5546 expect(errors, isNotNull, reason: result.name); 5547 expect(errors, isNotNull, reason: result.name);
5547 errorListener = new GatheringErrorListener(); 5548 errorListener = new GatheringErrorListener();
5548 errorListener.addAll(errors); 5549 errorListener.addAll(errors);
5549 } 5550 }
5550 } 5551 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698