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

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

Issue 1281793004: fix sorting of compilation unit members - related to #23947 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 4 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/ast.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9fce39c333c6f8c3269db918ef926230577ea7f2..98e80de36f5522bf50147d2a8d31bbfa39935ccf 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -3338,6 +3338,17 @@ class B = Object with A {}''',
parseExpression("m(f() => 0);", [ParserErrorCode.EXPECTED_TOKEN]);
}
+ void test_declarationBeforeDirective() {
+ CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+ "class foo { } import 'bar.dart';",
+ [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
+ expect(unit.directives, hasLength(1));
+ expect(unit.declarations, hasLength(1));
+ ClassDeclaration classDecl = unit.childEntities.first;
+ expect(classDecl, isNotNull);
+ expect(classDecl.name.name, 'foo');
+ }
+
void test_importDirectivePartial_as() {
CompilationUnit unit = ParserTestCase.parseCompilationUnit(
"import 'b.dart' d as b;", [ParserErrorCode.UNEXPECTED_TOKEN]);
« no previous file with comments | « pkg/analyzer/lib/src/generated/ast.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698