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

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

Issue 55143004: Issue 14688. Resolve more annotation variants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 56f6b198b07506bf2d8c01e295bce6ad06cfb9fe..6c3cc620b3db5cd58fe6128edaefb6c000e8a785 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
@@ -1362,7 +1362,34 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
- public void test_invalidAnnotation_constantVariable() throws Exception {
+ public void test_invalidAnnotation_constantVariable_field() throws Exception {
+ Source source = addSource(createSource(//
+ "@A.C",
+ "class A {",
+ " static const C = 0;",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
+ public void test_invalidAnnotation_constantVariable_field_importWithPrefix() throws Exception {
+ addSource("/lib.dart", createSource(//
+ "library lib;",
+ "class A {",
+ " static const C = 0;",
+ "}"));
+ Source source = addSource(createSource(//
+ "import 'lib.dart' as p;",
+ "@p.A.C",
+ "main() {",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
+ public void test_invalidAnnotation_constantVariable_topLevel() throws Exception {
Source source = addSource(createSource(//
"const C = 0;",
"@C",
@@ -1373,7 +1400,7 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
- public void test_invalidAnnotation_importWithPrefix_constantVariable() throws Exception {
+ public void test_invalidAnnotation_constantVariable_topLevel_importWithPrefix() throws Exception {
addSource("/lib.dart", createSource(//
"library lib;",
"const C = 0;"));
@@ -1387,7 +1414,23 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
- public void test_invalidAnnotation_importWithPrefix_constConstructor() throws Exception {
+ public void test_invalidAnnotation_constConstructor_importWithPrefix() throws Exception {
+ addSource("/lib.dart", createSource(//
+ "library lib;",
+ "class A {",
+ " const A(int p);",
+ "}"));
+ Source source = addSource(createSource(//
+ "import 'lib.dart' as p;",
+ "@p.A(42)",
+ "main() {",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
+ public void test_invalidAnnotation_constConstructor_named_importWithPrefix() throws Exception {
addSource("/lib.dart", createSource(//
"library lib;",
"class A {",

Powered by Google App Engine
This is Rietveld 408576698