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

Unified Diff: pkg/analyzer/test/generated/non_hint_code_test.dart

Issue 1797593003: Stop reporting use of deprecated members from within deprecated members (issue 25966) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/generated/non_hint_code_test.dart
diff --git a/pkg/analyzer/test/generated/non_hint_code_test.dart b/pkg/analyzer/test/generated/non_hint_code_test.dart
index fff8a6a6b86155e061d59dc644a40ca372988a21..8d9c19d532da22e4d3427d572037c012dc23c836 100644
--- a/pkg/analyzer/test/generated/non_hint_code_test.dart
+++ b/pkg/analyzer/test/generated/non_hint_code_test.dart
@@ -158,11 +158,66 @@ f() {
verify([source]);
}
- void test_deprecatedAnnotationUse_classWithConstructor() {
+ void test_deprecatedMemberUse_inDeprecatedClass() {
Source source = addSource(r'''
@deprecated
+f() {}
+
+@deprecated
class C {
- C();
+ m() {
+ f();
+ }
+}
+''');
+ computeLibrarySourceErrors(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void test_deprecatedMemberUse_inDeprecatedFunction() {
+ Source source = addSource(r'''
+@deprecated
+f() {}
+
+@deprecated
+g() {
+ f();
+}
+''');
+ computeLibrarySourceErrors(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void test_deprecatedMemberUse_inDeprecatedMethod() {
+ Source source = addSource(r'''
+@deprecated
+f() {}
+
+class C {
+ @deprecated
+ m() {
+ f();
+ }
+}
+''');
+ computeLibrarySourceErrors(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void test_deprecatedMemberUse_inDeprecatedMethod_inDeprecatedClass() {
+ Source source = addSource(r'''
+@deprecated
+f() {}
+
+@deprecated
+class C {
+ @deprecated
+ m() {
+ f();
+ }
}
''');
computeLibrarySourceErrors(source);
@@ -1095,7 +1150,7 @@ class PubSuggestionCodeTest extends ResolverTestCase {
cacheSource("/myproj/pubspec.yaml", "");
cacheSource("/myproj/lib/other.dart", "");
Source source =
- addNamedSource("/myproj/web/test.dart", "import '../lib/other.dart';");
+ addNamedSource("/myproj/web/test.dart", "import '../lib/other.dart';");
computeLibrarySourceErrors(source);
assertErrors(
source, [HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE]);
@@ -1104,7 +1159,7 @@ class PubSuggestionCodeTest extends ResolverTestCase {
void test_import_referenceIntoLibDirectory_no_pubspec() {
cacheSource("/myproj/lib/other.dart", "");
Source source =
- addNamedSource("/myproj/web/test.dart", "import '../lib/other.dart';");
+ addNamedSource("/myproj/web/test.dart", "import '../lib/other.dart';");
computeLibrarySourceErrors(source);
assertNoErrors(source);
}
@@ -1113,7 +1168,7 @@ class PubSuggestionCodeTest extends ResolverTestCase {
cacheSource("/myproj/pubspec.yaml", "");
cacheSource("/myproj/web/other.dart", "");
Source source =
- addNamedSource("/myproj/lib/test.dart", "import '../web/other.dart';");
+ addNamedSource("/myproj/lib/test.dart", "import '../web/other.dart';");
computeLibrarySourceErrors(source);
assertErrors(
source, [HintCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE]);
@@ -1122,7 +1177,7 @@ class PubSuggestionCodeTest extends ResolverTestCase {
void test_import_referenceOutOfLibDirectory_no_pubspec() {
cacheSource("/myproj/web/other.dart", "");
Source source =
- addNamedSource("/myproj/lib/test.dart", "import '../web/other.dart';");
+ addNamedSource("/myproj/lib/test.dart", "import '../web/other.dart';");
computeLibrarySourceErrors(source);
assertNoErrors(source);
}
@@ -1131,7 +1186,7 @@ class PubSuggestionCodeTest extends ResolverTestCase {
cacheSource("/myproj/pubspec.yaml", "");
cacheSource("/myproj/lib/other.dart", "");
Source source =
- addNamedSource("/myproj/lib/test.dart", "import 'other.dart';");
+ addNamedSource("/myproj/lib/test.dart", "import 'other.dart';");
computeLibrarySourceErrors(source);
assertNoErrors(source);
}
@@ -1149,7 +1204,7 @@ class PubSuggestionCodeTest extends ResolverTestCase {
cacheSource("/myproj/pubspec.yaml", "");
cacheSource("/myproj/web/other.dart", "");
Source source =
- addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';");
+ addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';");
computeLibrarySourceErrors(source);
assertNoErrors(source);
}
« pkg/analyzer/lib/src/generated/resolver.dart ('K') | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698