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

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

Issue 16231012: Cover the 'extends' and typedef cases of the CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE e… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index 8d727a3a4c26a8ae71ae420e338bdf1abd2ca528..afae2c3b5080a56af06b7f56e6521d063916872f 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -1460,14 +1460,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void test_implementsSelf() throws Exception {
- Source source = addSource(createSource(//
- "class A implements A {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.IMPLEMENTS_SELF);
- verify(source);
- }
-
public void test_implicitThisReferenceInInitializer_field() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -2494,7 +2486,29 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void test_recursiveInterfaceInheritance() throws Exception {
+ public void test_recursiveInterfaceInheritance_extends() throws Exception {
+ Source source = addSource(createSource(//
+ "class A extends B {}",
+ "class B extends A {}"));
+ resolve(source);
+ assertErrors(
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE);
+ verify(source);
+ }
+
+ public void test_recursiveInterfaceInheritance_extends_implements() throws Exception {
+ Source source = addSource(createSource(//
+ "class A extends B {}",
+ "class B implements A {}"));
+ resolve(source);
+ assertErrors(
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE);
+ verify(source);
+ }
+
+ public void test_recursiveInterfaceInheritance_implements() throws Exception {
Source source = addSource(createSource(//
"class A implements B {}",
"class B implements A {}"));
@@ -2507,6 +2521,15 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
public void test_recursiveInterfaceInheritance_tail() throws Exception {
Source source = addSource(createSource(//
+ "abstract class A implements A {}",
+ "class B implements A {}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS);
+ verify(source);
+ }
+
+ public void test_recursiveInterfaceInheritance_tail2() throws Exception {
+ Source source = addSource(createSource(//
"abstract class A implements B {}",
"abstract class B implements A {}",
"class C implements A {}"));
@@ -2517,7 +2540,7 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void test_recursiveInterfaceInheritance_tail2() throws Exception {
+ public void test_recursiveInterfaceInheritance_tail3() throws Exception {
Source source = addSource(createSource(//
"abstract class A implements B {}",
"abstract class B implements C {}",
@@ -2531,6 +2554,32 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_recursiveInterfaceInheritanceBaseCaseExtends() throws Exception {
+ Source source = addSource(createSource(//
+ "class A extends A {}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS);
+ verify(source);
+ }
+
+ public void test_recursiveInterfaceInheritanceBaseCaseImplements() throws Exception {
+ Source source = addSource(createSource(//
+ "class A implements A {}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS);
+ verify(source);
+ }
+
+ public void test_recursiveInterfaceInheritanceBaseCaseImplements_typedef() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {}",
+ "class M {}",
+ "typedef B = A with M implements B;"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS);
+ verify(source);
+ }
+
public void test_redirectToNonConstConstructor() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698