| 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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 } | 617 } |
| 618 f(A a) { | 618 f(A a) { |
| 619 A b; | 619 A b; |
| 620 a += b; | 620 a += b; |
| 621 }'''); | 621 }'''); |
| 622 computeLibrarySourceErrors(source); | 622 computeLibrarySourceErrors(source); |
| 623 assertErrors(source, [HintCode.DEPRECATED_MEMBER_USE]); | 623 assertErrors(source, [HintCode.DEPRECATED_MEMBER_USE]); |
| 624 verify([source]); | 624 verify([source]); |
| 625 } | 625 } |
| 626 | 626 |
| 627 void test_deprecatedAnnotationUse_deprecated() { | 627 void test_deprecatedAnnotationUse_Deprecated() { |
| 628 Source source = addSource(r''' | 628 Source source = addSource(r''' |
| 629 class A { | 629 class A { |
| 630 @deprecated | 630 @Deprecated('0.9') |
| 631 m() {} | 631 m() {} |
| 632 n() {m();} | 632 n() {m();} |
| 633 }'''); | 633 }'''); |
| 634 computeLibrarySourceErrors(source); | 634 computeLibrarySourceErrors(source); |
| 635 assertErrors(source, [HintCode.DEPRECATED_MEMBER_USE]); | 635 assertErrors(source, [HintCode.DEPRECATED_MEMBER_USE]); |
| 636 verify([source]); | 636 verify([source]); |
| 637 } | 637 } |
| 638 | 638 |
| 639 void test_deprecatedAnnotationUse_Deprecated() { | 639 void test_deprecatedAnnotationUse_deprecated() { |
| 640 Source source = addSource(r''' | 640 Source source = addSource(r''' |
| 641 class A { | 641 class A { |
| 642 @Deprecated('0.9') | 642 @deprecated |
| 643 m() {} | 643 m() {} |
| 644 n() {m();} | 644 n() {m();} |
| 645 }'''); | 645 }'''); |
| 646 computeLibrarySourceErrors(source); | 646 computeLibrarySourceErrors(source); |
| 647 assertErrors(source, [HintCode.DEPRECATED_MEMBER_USE]); | 647 assertErrors(source, [HintCode.DEPRECATED_MEMBER_USE]); |
| 648 verify([source]); | 648 verify([source]); |
| 649 } | 649 } |
| 650 | 650 |
| 651 void test_deprecatedAnnotationUse_export() { | 651 void test_deprecatedAnnotationUse_export() { |
| 652 Source source = addSource("export 'deprecated_library.dart';"); | 652 Source source = addSource("export 'deprecated_library.dart';"); |
| (...skipping 2335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2988 n() { | 2988 n() { |
| 2989 var a = m(), b = m(); | 2989 var a = m(), b = m(); |
| 2990 } | 2990 } |
| 2991 }'''); | 2991 }'''); |
| 2992 computeLibrarySourceErrors(source); | 2992 computeLibrarySourceErrors(source); |
| 2993 assertErrors( | 2993 assertErrors( |
| 2994 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]); | 2994 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]); |
| 2995 verify([source]); | 2995 verify([source]); |
| 2996 } | 2996 } |
| 2997 } | 2997 } |
| OLD | NEW |