| OLD | NEW |
| 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 5650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5661 } | 5661 } |
| 5662 | 5662 |
| 5663 main() { | 5663 main() { |
| 5664 const Test(); | 5664 const Test(); |
| 5665 } | 5665 } |
| 5666 '''); | 5666 '''); |
| 5667 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source); | 5667 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source); |
| 5668 computeResult(target, VERIFY_ERRORS, matcher: isVerifyUnitTask); | 5668 computeResult(target, VERIFY_ERRORS, matcher: isVerifyUnitTask); |
| 5669 // validate | 5669 // validate |
| 5670 _fillErrorListener(VERIFY_ERRORS); | 5670 _fillErrorListener(VERIFY_ERRORS); |
| 5671 errorListener.assertNoErrors(); | 5671 errorListener |
| 5672 .assertErrorsWithCodes([CompileTimeErrorCode.DUPLICATE_DEFINITION]); |
| 5672 } | 5673 } |
| 5673 | 5674 |
| 5674 test_perform_ConstantValidator_noInitializer() { | 5675 test_perform_ConstantValidator_noInitializer() { |
| 5675 Source source = newSource( | 5676 Source source = newSource( |
| 5676 '/test.dart', | 5677 '/test.dart', |
| 5677 ''' | 5678 ''' |
| 5678 const x; | 5679 const x; |
| 5679 '''); | 5680 '''); |
| 5680 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source); | 5681 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source); |
| 5681 computeResult(target, VERIFY_ERRORS, matcher: isVerifyUnitTask); | 5682 computeResult(target, VERIFY_ERRORS, matcher: isVerifyUnitTask); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5872 /** | 5873 /** |
| 5873 * Fill [errorListener] with [result] errors in the current [task]. | 5874 * Fill [errorListener] with [result] errors in the current [task]. |
| 5874 */ | 5875 */ |
| 5875 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { | 5876 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { |
| 5876 List<AnalysisError> errors = task.outputs[result] as List<AnalysisError>; | 5877 List<AnalysisError> errors = task.outputs[result] as List<AnalysisError>; |
| 5877 expect(errors, isNotNull, reason: result.name); | 5878 expect(errors, isNotNull, reason: result.name); |
| 5878 errorListener = new GatheringErrorListener(); | 5879 errorListener = new GatheringErrorListener(); |
| 5879 errorListener.addAll(errors); | 5880 errorListener.addAll(errors); |
| 5880 } | 5881 } |
| 5881 } | 5882 } |
| OLD | NEW |