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

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

Issue 829133007: Enable enum and deferred import support (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 d24132a9f72b41f26ddf6fcbcf898f7eb7a7d647..260e6ce2ba42009ac82188bb809fbf22dd0bff5d 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
@@ -19,7 +19,6 @@ import com.google.dart.engine.error.ErrorCode;
import com.google.dart.engine.error.HintCode;
import com.google.dart.engine.error.StaticTypeWarningCode;
import com.google.dart.engine.error.StaticWarningCode;
-import com.google.dart.engine.parser.ParserErrorCode;
import com.google.dart.engine.source.Source;
public class StaticWarningCodeTest extends ResolverTestCase {
@@ -1330,18 +1329,13 @@ public class StaticWarningCodeTest extends ResolverTestCase {
}
public void test_importOfNonLibrary() throws Exception {
- resolveWithAndWithoutExperimental(
- new String[] {createSource(//
- "part of lib;",
- "class A {}"),//
- createSource(//
- "library lib;",
- "import 'lib1.dart' deferred as p;",
- "var a = new p.A();")},
- new ErrorCode[] {
- CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY,
- ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
- new ErrorCode[] {StaticWarningCode.IMPORT_OF_NON_LIBRARY});
+ resolve(new String[] {createSource(//
+ "part of lib;",
+ "class A {}"),//
+ createSource(//
+ "library lib;",
+ "import 'lib1.dart' deferred as p;",
+ "var a = new p.A();")}, new ErrorCode[] {StaticWarningCode.IMPORT_OF_NON_LIBRARY});
}
public void test_inconsistentMethodInheritanceGetterAndMethod() throws Exception {
@@ -2756,55 +2750,46 @@ public class StaticWarningCodeTest extends ResolverTestCase {
}
public void test_typeAnnotationDeferredClass_asExpression() throws Exception {
- resolveWithAndWithoutExperimental(
- new String[] {createSource(//
- "library lib1;",
- "class A {}"),//
- createSource(//
- "library root;",
- "import 'lib1.dart' deferred as a;",
- "f(var v) {",
- " v as a.A;",
- "}")},
- new ErrorCode[] {ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
- new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
+ resolve(new String[] {createSource(//
+ "library lib1;",
+ "class A {}"),//
+ createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "f(var v) {",
+ " v as a.A;",
+ "}")}, new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
}
public void test_typeAnnotationDeferredClass_catchClause() throws Exception {
- resolveWithAndWithoutExperimental(
- new String[] {createSource(//
- "library lib1;",
- "class A {}"),//
- createSource(//
- "library root;",
- "import 'lib1.dart' deferred as a;",
- "f(var v) {",
- " try {",
- " } on a.A {",
- " }",
- "}")},
- new ErrorCode[] {ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
- new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
+ resolve(new String[] {createSource(//
+ "library lib1;",
+ "class A {}"),//
+ createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "f(var v) {",
+ " try {",
+ " } on a.A {",
+ " }",
+ "}")}, new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
}
public void test_typeAnnotationDeferredClass_fieldFormalParameter() throws Exception {
- resolveWithAndWithoutExperimental(
- new String[] {createSource(//
- "library lib1;",
- "class A {}"),//
- createSource(//
- "library root;",
- "import 'lib1.dart' deferred as a;",
- "class C {",
- " var v;",
- " C(a.A this.v);",
- "}")},
- new ErrorCode[] {ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
- new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
+ resolve(new String[] {createSource(//
+ "library lib1;",
+ "class A {}"),//
+ createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "class C {",
+ " var v;",
+ " C(a.A this.v);",
+ "}")}, new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
}
public void test_typeAnnotationDeferredClass_functionDeclaration_returnType() throws Exception {
- resolveWithAndWithoutExperimental(
+ resolve(
new String[] {createSource(//
"library lib1;",
"class A {}"),//
@@ -2812,99 +2797,80 @@ public class StaticWarningCodeTest extends ResolverTestCase {
"library root;",
"import 'lib1.dart' deferred as a;",
"a.A f() { return null; }")},
- new ErrorCode[] {ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
}
public void test_typeAnnotationDeferredClass_functionTypedFormalParameter_returnType()
throws Exception {
- resolveWithAndWithoutExperimental(
- new String[] {createSource(//
- "library lib1;",
- "class A {}"),//
- createSource(//
- "library root;",
- "import 'lib1.dart' deferred as a;",
- "f(a.A g()) {}")},
- new ErrorCode[] {ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
- new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
+ resolve(new String[] {createSource(//
+ "library lib1;",
+ "class A {}"),//
+ createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "f(a.A g()) {}")}, new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
}
public void test_typeAnnotationDeferredClass_isExpression() throws Exception {
- resolveWithAndWithoutExperimental(
- new String[] {createSource(//
- "library lib1;",
- "class A {}"),//
- createSource(//
- "library root;",
- "import 'lib1.dart' deferred as a;",
- "f(var v) {",
- " bool b = v is a.A;",
- "}")},
- new ErrorCode[] {ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
- new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
+ resolve(new String[] {createSource(//
+ "library lib1;",
+ "class A {}"),//
+ createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "f(var v) {",
+ " bool b = v is a.A;",
+ "}")}, new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
}
public void test_typeAnnotationDeferredClass_methodDeclaration_returnType() throws Exception {
- resolveWithAndWithoutExperimental(
- new String[] {createSource(//
- "library lib1;",
- "class A {}"),//
- createSource(//
- "library root;",
- "import 'lib1.dart' deferred as a;",
- "class C {",
- " a.A m() { return null; }",
- "}")},
- new ErrorCode[] {ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
- new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
+ resolve(new String[] {createSource(//
+ "library lib1;",
+ "class A {}"),//
+ createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "class C {",
+ " a.A m() { return null; }",
+ "}")}, new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
}
public void test_typeAnnotationDeferredClass_simpleFormalParameter() throws Exception {
- resolveWithAndWithoutExperimental(
- new String[] {createSource(//
- "library lib1;",
- "class A {}"),//
- createSource(//
- "library root;",
- "import 'lib1.dart' deferred as a;",
- "f(a.A v) {}")},
- new ErrorCode[] {ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
- new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
+ resolve(new String[] {createSource(//
+ "library lib1;",
+ "class A {}"),//
+ createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "f(a.A v) {}")}, new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
}
public void test_typeAnnotationDeferredClass_typeArgumentList() throws Exception {
- resolveWithAndWithoutExperimental(
- new String[] {createSource(//
- "library lib1;",
- "class A {}"),//
- createSource(//
- "library root;",
- "import 'lib1.dart' deferred as a;",
- "class C<E> {}",
- "C<a.A> c;")},
- new ErrorCode[] {ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
- new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
+ resolve(new String[] {createSource(//
+ "library lib1;",
+ "class A {}"),//
+ createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "class C<E> {}",
+ "C<a.A> c;")}, new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
}
public void test_typeAnnotationDeferredClass_typeArgumentList2() throws Exception {
- resolveWithAndWithoutExperimental(
- new String[] {createSource(//
- "library lib1;",
- "class A {}"),//
- createSource(//
- "library root;",
- "import 'lib1.dart' deferred as a;",
- "class C<E, F> {}",
- "C<a.A, a.A> c;")},
- new ErrorCode[] {ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
- new ErrorCode[] {
- StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS,
- StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
+ resolve(new String[] {createSource(//
+ "library lib1;",
+ "class A {}"),//
+ createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "class C<E, F> {}",
+ "C<a.A, a.A> c;")}, new ErrorCode[] {
+ StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS,
+ StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
}
public void test_typeAnnotationDeferredClass_typeParameter_bound() throws Exception {
- resolveWithAndWithoutExperimental(
+ resolve(
new String[] {createSource(//
"library lib1;",
"class A {}"),//
@@ -2912,21 +2878,17 @@ public class StaticWarningCodeTest extends ResolverTestCase {
"library root;",
"import 'lib1.dart' deferred as a;",
"class C<E extends a.A> {}")},
- new ErrorCode[] {ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
}
public void test_typeAnnotationDeferredClass_variableDeclarationList() throws Exception {
- resolveWithAndWithoutExperimental(
- new String[] {createSource(//
- "library lib1;",
- "class A {}"),//
- createSource(//
- "library root;",
- "import 'lib1.dart' deferred as a;",
- "a.A v;")},
- new ErrorCode[] {ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED},
- new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
+ resolve(new String[] {createSource(//
+ "library lib1;",
+ "class A {}"),//
+ createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "a.A v;")}, new ErrorCode[] {StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS});
}
public void test_typeParameterReferencedByStatic_field() throws Exception {

Powered by Google App Engine
This is Rietveld 408576698