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

Unified Diff: pkg/analyzer/test/dart/ast/ast_test.dart

Issue 1820743002: Issue 26051. Fix for MethodDeclartion.beginToken for external. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/testing/ast_factory.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/dart/ast/ast_test.dart
diff --git a/pkg/analyzer/test/dart/ast/ast_test.dart b/pkg/analyzer/test/dart/ast/ast_test.dart
index 7be2b72e87bd3aef56ec31b51abac2fa3f827b07..6cd446dba5f2efa6f466bee4cd6360509b5368f6 100644
--- a/pkg/analyzer/test/dart/ast/ast_test.dart
+++ b/pkg/analyzer/test/dart/ast/ast_test.dart
@@ -23,6 +23,7 @@ main() {
runReflectiveTests(ConstructorDeclarationTest);
runReflectiveTests(FieldFormalParameterTest);
runReflectiveTests(IndexExpressionTest);
+ runReflectiveTests(MethodDeclarationTest);
runReflectiveTests(NodeListTest);
runReflectiveTests(SimpleIdentifierTest);
runReflectiveTests(SimpleStringLiteralTest);
@@ -305,6 +306,44 @@ class IndexExpressionTest extends EngineTestCase {
}
@reflectiveTest
+class MethodDeclarationTest extends EngineTestCase {
+ void test_firstTokenAfterCommentAndMetadata_external() {
+ MethodDeclaration declaration =
+ AstFactory.methodDeclaration4(external: true, name: 'm');
+ expect(declaration.firstTokenAfterCommentAndMetadata,
+ declaration.externalKeyword);
+ }
+
+ void test_firstTokenAfterCommentAndMetadata_external_getter() {
+ MethodDeclaration declaration = AstFactory.methodDeclaration4(
+ external: true, property: Keyword.GET, name: 'm');
+ expect(declaration.firstTokenAfterCommentAndMetadata,
+ declaration.externalKeyword);
+ }
+
+ void test_firstTokenAfterCommentAndMetadata_external_operator() {
+ MethodDeclaration declaration = AstFactory.methodDeclaration4(
+ external: true, operator: true, name: 'm');
+ expect(declaration.firstTokenAfterCommentAndMetadata,
+ declaration.externalKeyword);
+ }
+
+ void test_firstTokenAfterCommentAndMetadata_getter() {
+ MethodDeclaration declaration =
+ AstFactory.methodDeclaration4(property: Keyword.GET, name: 'm');
+ expect(declaration.firstTokenAfterCommentAndMetadata,
+ declaration.propertyKeyword);
+ }
+
+ void test_firstTokenAfterCommentAndMetadata_operator() {
+ MethodDeclaration declaration =
+ AstFactory.methodDeclaration4(operator: true, name: 'm');
+ expect(declaration.firstTokenAfterCommentAndMetadata,
+ declaration.operatorKeyword);
+ }
+}
+
+@reflectiveTest
class NodeListTest extends EngineTestCase {
void test_add() {
AstNode parent = AstFactory.argumentList();
« no previous file with comments | « pkg/analyzer/lib/src/generated/testing/ast_factory.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698