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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java

Issue 15500002: Checkpoint for more inheritance error codes 'Missing inherited member' warnings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase with bleeding_edge Created 7 years, 7 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
index 44ffab6fb633b1089ba96ad59ffb08343f07c919..2d3507120b8d5e39ed1ace0e11cdf74acaabd0cf 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
@@ -184,30 +184,6 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
- public void fail_nonAbstractClassInheritsAbstractMember() throws Exception {
- Source source = addSource(createSource(//
- "class I {",
- " m(p) {}",
- "}",
- "class C implements I {",
- "}"));
- resolve(source);
- assertErrors(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER);
- verify(source);
- }
-
- public void fail_nonAbstractClassInheritsAbstractMethod() throws Exception {
- Source source = addSource(createSource(//
- "abstract class A {",
- " m(p);",
- "}",
- "class C extends A {",
- "}"));
- resolve(source);
- assertErrors(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_METHOD);
- verify(source);
- }
-
public void fail_nonType() throws Exception {
Source source = addSource(createSource(//
"var A = 0;",
@@ -767,6 +743,110 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_nonAbstractClassInheritsAbstractMemberMuliple_fromSuperclass() throws Exception {
+ Source source = addSource(createSource(//
+ "abstract class A {",
+ " m(p);",
+ " n(p);",
+ "}",
+ "class C extends A {",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_MULTIPLE);
+ verify(source);
+ }
+
+ public void test_nonAbstractClassInheritsAbstractMemberMultiple_fromInterface() throws Exception {
+ Source source = addSource(createSource(//
+ "class I {",
+ " m(p) {}",
+ " n(p) {}",
+ "}",
+ "class C implements I {",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_MULTIPLE);
+ verify(source);
+ }
+
+ public void test_nonAbstractClassInheritsAbstractMemberSingle_getter_fromInterface()
+ throws Exception {
+ Source source = addSource(createSource(//
+ "class I {",
+ " int get g {return 1;}",
+ "}",
+ "class C implements I {",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_SINGLE);
+ verify(source);
+ }
+
+ public void test_nonAbstractClassInheritsAbstractMemberSingle_getter_fromSuperclass()
+ throws Exception {
+ Source source = addSource(createSource(//
+ "abstract class A {",
+ " int get g;",
+ "}",
+ "class C extends A {",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_SINGLE);
+ verify(source);
+ }
+
+ public void test_nonAbstractClassInheritsAbstractMemberSingle_method_fromInterface()
+ throws Exception {
+ Source source = addSource(createSource(//
+ "class I {",
+ " m(p) {}",
+ "}",
+ "class C implements I {",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_SINGLE);
+ verify(source);
+ }
+
+ public void test_nonAbstractClassInheritsAbstractMemberSingle_method_fromSuperclass()
+ throws Exception {
+ Source source = addSource(createSource(//
+ "abstract class A {",
+ " m(p);",
+ "}",
+ "class C extends A {",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_SINGLE);
+ verify(source);
+ }
+
+ public void test_nonAbstractClassInheritsAbstractMemberSingle_setter_fromInterface()
+ throws Exception {
+ Source source = addSource(createSource(//
+ "class I {",
+ " set s(int i) {}",
+ "}",
+ "class C implements I {",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_SINGLE);
+ verify(source);
+ }
+
+ public void test_nonAbstractClassInheritsAbstractMemberSingle_setter_fromSuperclass()
+ throws Exception {
+ Source source = addSource(createSource(//
+ "abstract class A {",
+ " set s(int i);",
+ "}",
+ "class C extends A {",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_SINGLE);
+ verify(source);
+ }
+
public void test_nonTypeInCatchClause_noElement() throws Exception {
Source source = addSource(createSource(//
"f() {",

Powered by Google App Engine
This is Rietveld 408576698