| 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 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 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1832 '''); | 1832 '''); |
| 1833 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source); | 1833 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source); |
| 1834 computeResult(target, HINTS); | 1834 computeResult(target, HINTS); |
| 1835 expect(task, new isInstanceOf<GenerateHintsTask>()); | 1835 expect(task, new isInstanceOf<GenerateHintsTask>()); |
| 1836 // validate | 1836 // validate |
| 1837 _fillErrorListener(HINTS); | 1837 _fillErrorListener(HINTS); |
| 1838 errorListener.assertErrorsWithCodes(<ErrorCode>[HintCode.MISSING_RETURN]); | 1838 errorListener.assertErrorsWithCodes(<ErrorCode>[HintCode.MISSING_RETURN]); |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 test_perform_dart2js() { | 1841 test_perform_dart2js() { |
| 1842 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1843 options.dart2jsHint = true; |
| 1844 prepareAnalysisContext(options); |
| 1842 Source source = newSource( | 1845 Source source = newSource( |
| 1843 '/test.dart', | 1846 '/test.dart', |
| 1844 ''' | 1847 ''' |
| 1845 main(p) { | 1848 main(p) { |
| 1846 if (p is double) { | 1849 if (p is double) { |
| 1847 print('double'); | 1850 print('double'); |
| 1848 } | 1851 } |
| 1849 } | 1852 } |
| 1850 '''); | 1853 '''); |
| 1851 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source); | 1854 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source); |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2837 /** | 2840 /** |
| 2838 * Fill [errorListener] with [result] errors in the current [task]. | 2841 * Fill [errorListener] with [result] errors in the current [task]. |
| 2839 */ | 2842 */ |
| 2840 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { | 2843 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { |
| 2841 List<AnalysisError> errors = task.outputs[result]; | 2844 List<AnalysisError> errors = task.outputs[result]; |
| 2842 expect(errors, isNotNull, reason: result.name); | 2845 expect(errors, isNotNull, reason: result.name); |
| 2843 errorListener = new GatheringErrorListener(); | 2846 errorListener = new GatheringErrorListener(); |
| 2844 errorListener.addAll(errors); | 2847 errorListener.addAll(errors); |
| 2845 } | 2848 } |
| 2846 } | 2849 } |
| OLD | NEW |