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

Unified Diff: pkg/analysis_server/test/analysis/notification_overrides_test.dart

Issue 1273003005: Keep only unique overridden elements. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Stop when found the corresponding element in an interface. Created 5 years, 4 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
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_overrides.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/analysis/notification_overrides_test.dart
diff --git a/pkg/analysis_server/test/analysis/notification_overrides_test.dart b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
index 23393081e1c2cccf06e2c0bb60320248a51cbb9f..bd0343f5c557f352a246c8af53ddceeb902d0c0c 100644
--- a/pkg/analysis_server/test/analysis/notification_overrides_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
@@ -227,6 +227,58 @@ class C implements B {
});
}
+ test_interface_stopWhenFound() {
+ addTestFile('''
+class A {
+ m() {} // in A
+}
+class B extends A {
+ m() {} // in B
+}
+class C implements B {
+ m() {} // in C
+}
+''');
+ return prepareOverrides().then((_) {
+ assertHasOverride('m() {} // in C');
+ expect(override.interfaceMembers, hasLength(1));
+ assertHasInterfaceMember('m() {} // in B');
+ });
+ }
+
+ test_mix_sameMethod() {
+ addTestFile('''
+class A {
+ m() {} // in A
+}
+abstract class B extends A {
+}
+class C extends A implements A {
+ m() {} // in C
+}
+''');
+ return prepareOverrides().then((_) {
+ assertHasOverride('m() {} // in C');
+ assertHasSuperElement('m() {} // in A');
+ assertNoInterfaceMembers();
+ });
+ }
+
+ test_mix_sameMethod_Object_hashCode() {
+ addTestFile('''
+class A {}
+abstract class B {}
+class C extends A implements A {
+ int get hashCode => 42;
+}
+''');
+ return prepareOverrides().then((_) {
+ assertHasOverride('hashCode => 42;');
+ expect(override.superclassMember, isNotNull);
+ expect(override.interfaceMembers, isNull);
+ });
+ }
+
test_staticMembers() {
addTestFile('''
class A {
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_overrides.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698