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

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

Issue 274703002: Bit flip- re-enable deferred loading support in the analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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/NonErrorResolverTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
index 9eb6cf3a4ed41c157cd02e8629e708e3c9135b97..1849a33512d7d2ea2ef4875d5cd87e99fdfefc16 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
@@ -24,58 +24,6 @@ import com.google.dart.engine.parser.ParserErrorCode;
import com.google.dart.engine.source.Source;
public class NonErrorResolverTest extends ResolverTestCase {
- public void fail_constDeferredClass_new() throws Exception {
- addNamedSource("/lib1.dart", createSource(//
- "library lib1;",
- "class A {",
- " const A.b();",
- "}"));
- Source source = addSource(createSource(//
- "library root;",
- "import 'lib1.dart' deferred as a;",
- "main() {",
- " new a.A.b();",
- "}"));
- resolve(source);
- assertErrors(source);
- verify(source);
- }
-
- public void fail_loadLibraryDefined() throws Exception {
- addNamedSource("/lib.dart", createSource(//
- "library lib;",
- "foo() => 22;"));
- Source source = addSource(createSource(//
- "import 'lib.dart' deferred as other;",
- "main() {",
- " other.loadLibrary().then((_) => other.foo());",
- "}"));
- resolve(source);
- assertNoErrors(source);
- verify(source);
- }
-
- public void fail_sharedDeferredPrefix() throws Exception {
- addNamedSource("/lib1.dart", createSource(//
- "library lib1;",
- "f1() {}"));
- addNamedSource("/lib2.dart", createSource(//
- "library lib2;",
- "f2() {}"));
- addNamedSource("/lib3.dart", createSource(//
- "library lib3;",
- "f3() {}"));
- Source source = addSource(createSource(//
- "library root;",
- "import 'lib1.dart' deferred as lib1;",
- "import 'lib2.dart' as lib;",
- "import 'lib3.dart' as lib;",
- "main() { lib1.f1(); lib.f2(); lib.f3(); }"));
- resolve(source);
- assertNoErrors(source);
- verify(source);
- }
-
public void test_ambiguousExport() throws Exception {
Source source = addSource(createSource(//
"library L;",
@@ -639,6 +587,23 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_constDeferredClass_new() throws Exception {
+ addNamedSource("/lib1.dart", createSource(//
+ "library lib1;",
+ "class A {",
+ " const A.b();",
+ "}"));
+ Source source = addSource(createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as a;",
+ "main() {",
+ " new a.A.b();",
+ "}"));
+ resolve(source);
+ assertErrors(source);
+ verify(source);
+ }
+
public void test_constEval_functionTypeLiteral() throws Exception {
Source source = addSource(createSource(//
"typedef F();",
@@ -2250,6 +2215,20 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_loadLibraryDefined() throws Exception {
+ addNamedSource("/lib.dart", createSource(//
+ "library lib;",
+ "foo() => 22;"));
+ Source source = addSource(createSource(//
+ "import 'lib.dart' deferred as other;",
+ "main() {",
+ " other.loadLibrary().then((_) => other.foo());",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
public void test_mapKeyTypeNotAssignable() throws Exception {
Source source = addSource(createSource(//
"var v = <String, int > {'a' : 1};"));
@@ -3545,6 +3524,27 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_sharedDeferredPrefix() throws Exception {
+ addNamedSource("/lib1.dart", createSource(//
+ "library lib1;",
+ "f1() {}"));
+ addNamedSource("/lib2.dart", createSource(//
+ "library lib2;",
+ "f2() {}"));
+ addNamedSource("/lib3.dart", createSource(//
+ "library lib3;",
+ "f3() {}"));
+ Source source = addSource(createSource(//
+ "library root;",
+ "import 'lib1.dart' deferred as lib1;",
+ "import 'lib2.dart' as lib;",
+ "import 'lib3.dart' as lib;",
+ "main() { lib1.f1(); lib.f2(); lib.f3(); }"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
public void test_staticAccessToInstanceMember_annotation() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698