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

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

Issue 2539243002: Transition analyzer and analysis_server to new astFactory; remove old AST factory methods. (Closed)
Patch Set: Update CHANGELOG Created 4 years 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/utilities_test.dart
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index 88b88d575fcefac8a48241955e0f0412f5bc25e0..050a6c141862f372fdbdd49242bd4d2519e9d228 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.dart
@@ -7,6 +7,7 @@ library analyzer.test.generated.utilities_test;
import 'dart:collection';
import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/src/dart/ast/token.dart';
@@ -1606,7 +1607,7 @@ class ExceptionHandlingDelegatingAstVisitorTest extends EngineTestCase {
dynamic exception, StackTrace stackTrace) {
handlerInvoked = true;
});
- new NullLiteral(null).accept(visitor);
+ astFactory.nullLiteral(null).accept(visitor);
expect(handlerInvoked, isTrue);
}
}
@@ -3063,8 +3064,7 @@ class NodeReplacerTest extends EngineTestCase {
AstTestFactory.fieldDeclaration2(
false, null, [AstTestFactory.variableDeclaration("f")])
]);
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
node.nativeClause = AstTestFactory.nativeClause("");
@@ -3087,8 +3087,7 @@ class NodeReplacerTest extends EngineTestCase {
AstTestFactory.typeName4("B"),
AstTestFactory.withClause([AstTestFactory.typeName4("C")]),
AstTestFactory.implementsClause([AstTestFactory.typeName4("D")]));
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_4());
@@ -3100,15 +3099,15 @@ class NodeReplacerTest extends EngineTestCase {
}
void test_comment() {
- Comment node = Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
- node.references
- .add(new CommentReference(null, AstTestFactory.identifier3("x")));
+ Comment node = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
+ node.references.add(
+ astFactory.commentReference(null, AstTestFactory.identifier3("x")));
_assertReplace(node, new ListGetter_NodeReplacerTest_test_comment(0));
}
void test_commentReference() {
CommentReference node =
- new CommentReference(null, AstTestFactory.identifier3("x"));
+ astFactory.commentReference(null, AstTestFactory.identifier3("x"));
_assertReplace(node, new Getter_NodeReplacerTest_test_commentReference());
}
@@ -3151,8 +3150,7 @@ class NodeReplacerTest extends EngineTestCase {
false, "x", AstTestFactory.integer(0))
],
AstTestFactory.emptyFunctionBody());
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
node.redirectedConstructor =
@@ -3196,8 +3194,7 @@ class NodeReplacerTest extends EngineTestCase {
void test_declaredIdentifier() {
DeclaredIdentifier node =
AstTestFactory.declaredIdentifier4(AstTestFactory.typeName4("C"), "i");
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(node, new Getter_NodeReplacerTest_test_declaredIdentifier());
@@ -3223,8 +3220,8 @@ class NodeReplacerTest extends EngineTestCase {
}
void test_enumConstantDeclaration() {
- EnumConstantDeclaration node = new EnumConstantDeclaration(
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST),
+ EnumConstantDeclaration node = astFactory.enumConstantDeclaration(
+ astFactory.endOfLineComment(EMPTY_TOKEN_LIST),
[AstTestFactory.annotation(AstTestFactory.identifier3("a"))],
AstTestFactory.identifier3("C"));
_assertReplace(
@@ -3234,8 +3231,7 @@ class NodeReplacerTest extends EngineTestCase {
void test_enumDeclaration() {
EnumDeclaration node = AstTestFactory.enumDeclaration2("E", ["ONE", "TWO"]);
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(node, new Getter_NodeReplacerTest_test_enumDeclaration());
@@ -3246,8 +3242,7 @@ class NodeReplacerTest extends EngineTestCase {
ExportDirective node = AstTestFactory.exportDirective2("", [
AstTestFactory.hideCombinator2(["C"])
]);
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_testNamespaceDirective(node);
@@ -3279,8 +3274,7 @@ class NodeReplacerTest extends EngineTestCase {
null,
AstTestFactory.typeName4("C"),
[AstTestFactory.variableDeclaration("c")]);
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(node, new Getter_NodeReplacerTest_test_fieldDeclaration());
@@ -3293,8 +3287,7 @@ class NodeReplacerTest extends EngineTestCase {
AstTestFactory.typeName4("C"),
"f",
AstTestFactory.formalParameterList());
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata = [
AstTestFactory.annotation(AstTestFactory.identifier3("a"))
];
@@ -3380,8 +3373,7 @@ class NodeReplacerTest extends EngineTestCase {
"f",
AstTestFactory.functionExpression2(AstTestFactory.formalParameterList(),
AstTestFactory.blockFunctionBody(AstTestFactory.block())));
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(
@@ -3431,8 +3423,7 @@ class NodeReplacerTest extends EngineTestCase {
"F",
AstTestFactory.typeParameterList(["E"]),
AstTestFactory.formalParameterList());
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(
@@ -3449,8 +3440,7 @@ class NodeReplacerTest extends EngineTestCase {
FunctionTypedFormalParameter node = AstTestFactory
.functionTypedFormalParameter(AstTestFactory.typeName4("R"), "f",
[AstTestFactory.simpleFormalParameter3("p")]);
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata = [
AstTestFactory.annotation(AstTestFactory.identifier3("a"))
];
@@ -3489,8 +3479,7 @@ class NodeReplacerTest extends EngineTestCase {
AstTestFactory.showCombinator2(["A"]),
AstTestFactory.hideCombinator2(["B"])
]);
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(node, new Getter_NodeReplacerTest_test_importDirective());
@@ -3542,8 +3531,7 @@ class NodeReplacerTest extends EngineTestCase {
void test_libraryDirective() {
LibraryDirective node = AstTestFactory.libraryDirective2("lib");
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(node, new Getter_NodeReplacerTest_test_libraryDirective());
@@ -3590,8 +3578,7 @@ class NodeReplacerTest extends EngineTestCase {
AstTestFactory.identifier3("m"),
AstTestFactory.formalParameterList(),
AstTestFactory.blockFunctionBody(AstTestFactory.block()));
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(node, new Getter_NodeReplacerTest_test_methodDeclaration());
@@ -3638,8 +3625,7 @@ class NodeReplacerTest extends EngineTestCase {
void test_partDirective() {
PartDirective node = AstTestFactory.partDirective2("");
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_testUriBasedDirective(node);
@@ -3648,8 +3634,7 @@ class NodeReplacerTest extends EngineTestCase {
void test_partOfDirective() {
PartOfDirective node = AstTestFactory
.partOfDirective(AstTestFactory.libraryIdentifier2(["lib"]));
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(node, new Getter_NodeReplacerTest_test_partOfDirective());
@@ -3706,8 +3691,7 @@ class NodeReplacerTest extends EngineTestCase {
void test_simpleFormalParameter() {
SimpleFormalParameter node = AstTestFactory.simpleFormalParameter4(
AstTestFactory.typeName4("T"), "p");
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata = [
AstTestFactory.annotation(AstTestFactory.identifier3("a"))
];
@@ -3768,8 +3752,7 @@ class NodeReplacerTest extends EngineTestCase {
TopLevelVariableDeclaration node = AstTestFactory
.topLevelVariableDeclaration(null, AstTestFactory.typeName4("T"),
[AstTestFactory.variableDeclaration("t")]);
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(
@@ -3819,8 +3802,7 @@ class NodeReplacerTest extends EngineTestCase {
void test_variableDeclaration() {
VariableDeclaration node =
AstTestFactory.variableDeclaration2("a", AstTestFactory.nullLiteral());
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(
@@ -3835,8 +3817,7 @@ class NodeReplacerTest extends EngineTestCase {
null,
AstTestFactory.typeName4("T"),
[AstTestFactory.variableDeclaration("a")]);
- node.documentationComment =
- Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
+ node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
_assertReplace(

Powered by Google App Engine
This is Rietveld 408576698