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

Unified Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 1083093002: Don't permit annotations inside variable declarations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix a bogus comment. Created 5 years, 8 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: pkg/analyzer/test/generated/parser_test.dart
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 514c0d70dcc052b36272cf69ffe245a82d2c5d03..7919ccf47363daee005ea713096405d7fe81cf55 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -485,10 +485,6 @@ class C {
EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression,
BinaryExpression, expression.leftOperand);
}
-
- void test_topLevelVariable_withMetadata() {
- ParserTestCase.parseCompilationUnit("String @A string;");
- }
}
/**
@@ -1899,6 +1895,14 @@ class Foo {
[ParserErrorCode.TOP_LEVEL_OPERATOR]);
}
+ void test_topLevelVariable_withMetadata() {
+ ParserTestCase.parseCompilationUnit("String @A string;", [
+ ParserErrorCode.MISSING_IDENTIFIER,
+ ParserErrorCode.EXPECTED_TOKEN,
+ ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE
+ ]);
+ }
+
void test_typedefInClass_withoutReturnType() {
ParserTestCase.parseCompilationUnit(
"class C { typedef F(x); }", [ParserErrorCode.TYPEDEF_IN_CLASS]);
@@ -3271,28 +3275,25 @@ class B = Object with A {}''', [ParserErrorCode.EXPECTED_TOKEN]);
void test_importDirectivePartial_as() {
CompilationUnit unit = ParserTestCase.parseCompilationUnit(
- "import 'b.dart' d as b;",
- [ParserErrorCode.UNEXPECTED_TOKEN]);
+ "import 'b.dart' d as b;", [ParserErrorCode.UNEXPECTED_TOKEN]);
ImportDirective importDirective = unit.childEntities.first;
expect(importDirective.asKeyword, isNotNull);
expect(unit.directives, hasLength(1));
expect(unit.declarations, hasLength(0));
}
- void test_importDirectivePartial_show() {
+ void test_importDirectivePartial_hide() {
CompilationUnit unit = ParserTestCase.parseCompilationUnit(
- "import 'b.dart' d show foo;",
- [ParserErrorCode.UNEXPECTED_TOKEN]);
+ "import 'b.dart' d hide foo;", [ParserErrorCode.UNEXPECTED_TOKEN]);
ImportDirective importDirective = unit.childEntities.first;
expect(importDirective.combinators, hasLength(1));
expect(unit.directives, hasLength(1));
expect(unit.declarations, hasLength(0));
}
- void test_importDirectivePartial_hide() {
+ void test_importDirectivePartial_show() {
CompilationUnit unit = ParserTestCase.parseCompilationUnit(
- "import 'b.dart' d hide foo;",
- [ParserErrorCode.UNEXPECTED_TOKEN]);
+ "import 'b.dart' d show foo;", [ParserErrorCode.UNEXPECTED_TOKEN]);
ImportDirective importDirective = unit.childEntities.first;
expect(importDirective.combinators, hasLength(1));
expect(unit.directives, hasLength(1));

Powered by Google App Engine
This is Rietveld 408576698