| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.generated.hint_code_test; | 5 library analyzer.test.generated.hint_code_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/engine.dart'; | 7 import 'package:analyzer/src/generated/engine.dart'; |
| 8 import 'package:analyzer/src/generated/error.dart'; | 8 import 'package:analyzer/src/generated/error.dart'; |
| 9 import 'package:analyzer/src/generated/source_io.dart'; | 9 import 'package:analyzer/src/generated/source_io.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 A.named() {} | 806 A.named() {} |
| 807 } | 807 } |
| 808 class B extends A { | 808 class B extends A { |
| 809 B() : super.named() {} | 809 B() : super.named() {} |
| 810 }'''); | 810 }'''); |
| 811 computeLibrarySourceErrors(source); | 811 computeLibrarySourceErrors(source); |
| 812 assertErrors(source, [HintCode.DEPRECATED_MEMBER_USE]); | 812 assertErrors(source, [HintCode.DEPRECATED_MEMBER_USE]); |
| 813 verify([source]); | 813 verify([source]); |
| 814 } | 814 } |
| 815 | 815 |
| 816 void test_deprecatedAnnotationUse_call() { |
| 817 Source source = addSource(r''' |
| 818 class A { |
| 819 @deprecated |
| 820 call() {} |
| 821 m() { |
| 822 A a = new A(); |
| 823 a(); |
| 824 } |
| 825 }'''); |
| 826 computeLibrarySourceErrors(source); |
| 827 assertErrors(source, [HintCode.DEPRECATED_MEMBER_USE]); |
| 828 verify([source]); |
| 829 } |
| 830 |
| 816 void test_divisionOptimization_double() { | 831 void test_divisionOptimization_double() { |
| 817 Source source = addSource(r''' | 832 Source source = addSource(r''' |
| 818 f(double x, double y) { | 833 f(double x, double y) { |
| 819 var v = (x / y).toInt(); | 834 var v = (x / y).toInt(); |
| 820 }'''); | 835 }'''); |
| 821 computeLibrarySourceErrors(source); | 836 computeLibrarySourceErrors(source); |
| 822 assertErrors(source, [HintCode.DIVISION_OPTIMIZATION]); | 837 assertErrors(source, [HintCode.DIVISION_OPTIMIZATION]); |
| 823 verify([source]); | 838 verify([source]); |
| 824 } | 839 } |
| 825 | 840 |
| (...skipping 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3286 n() { | 3301 n() { |
| 3287 var a = m(), b = m(); | 3302 var a = m(), b = m(); |
| 3288 } | 3303 } |
| 3289 }'''); | 3304 }'''); |
| 3290 computeLibrarySourceErrors(source); | 3305 computeLibrarySourceErrors(source); |
| 3291 assertErrors( | 3306 assertErrors( |
| 3292 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]); | 3307 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]); |
| 3293 verify([source]); | 3308 verify([source]); |
| 3294 } | 3309 } |
| 3295 } | 3310 } |
| OLD | NEW |