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

Side by Side Diff: pkg/analyzer/test/generated/utilities_test.dart

Issue 1715723002: Fix node replacer to handle comments on variable declaration lists (issue 25818) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/utilities.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.generated.utilities_test; 5 library analyzer.test.generated.utilities_test;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 3733 matching lines...) Expand 10 before | Expand all | Expand 10 after
3744 _assertReplace( 3744 _assertReplace(
3745 node, new Getter_NodeReplacerTest_test_variableDeclaration()); 3745 node, new Getter_NodeReplacerTest_test_variableDeclaration());
3746 _assertReplace( 3746 _assertReplace(
3747 node, new Getter_NodeReplacerTest_test_variableDeclaration_2()); 3747 node, new Getter_NodeReplacerTest_test_variableDeclaration_2());
3748 _testAnnotatedNode(node); 3748 _testAnnotatedNode(node);
3749 } 3749 }
3750 3750
3751 void test_variableDeclarationList() { 3751 void test_variableDeclarationList() {
3752 VariableDeclarationList node = AstFactory.variableDeclarationList( 3752 VariableDeclarationList node = AstFactory.variableDeclarationList(
3753 null, AstFactory.typeName4("T"), [AstFactory.variableDeclaration("a")]); 3753 null, AstFactory.typeName4("T"), [AstFactory.variableDeclaration("a")]);
3754 node.documentationComment =
3755 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
3756 node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
3754 _assertReplace( 3757 _assertReplace(
3755 node, new Getter_NodeReplacerTest_test_variableDeclarationList()); 3758 node, new Getter_NodeReplacerTest_test_variableDeclarationList());
3756 _assertReplace( 3759 _assertReplace(
3757 node, new ListGetter_NodeReplacerTest_test_variableDeclarationList(0)); 3760 node, new ListGetter_NodeReplacerTest_test_variableDeclarationList(0));
3761 _testAnnotatedNode(node);
3758 } 3762 }
3759 3763
3760 void test_variableDeclarationStatement() { 3764 void test_variableDeclarationStatement() {
3761 VariableDeclarationStatement node = AstFactory.variableDeclarationStatement( 3765 VariableDeclarationStatement node = AstFactory.variableDeclarationStatement(
3762 null, AstFactory.typeName4("T"), [AstFactory.variableDeclaration("a")]); 3766 null, AstFactory.typeName4("T"), [AstFactory.variableDeclaration("a")]);
3763 _assertReplace( 3767 _assertReplace(
3764 node, new Getter_NodeReplacerTest_test_variableDeclarationStatement()); 3768 node, new Getter_NodeReplacerTest_test_variableDeclarationStatement());
3765 } 3769 }
3766 3770
3767 void test_whileStatement() { 3771 void test_whileStatement() {
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
4331 } 4335 }
4332 4336
4333 void test_get_added() { 4337 void test_get_added() {
4334 TokenMap tokenMap = new TokenMap(); 4338 TokenMap tokenMap = new TokenMap();
4335 Token key = TokenFactory.tokenFromType(TokenType.AT); 4339 Token key = TokenFactory.tokenFromType(TokenType.AT);
4336 Token value = TokenFactory.tokenFromType(TokenType.AT); 4340 Token value = TokenFactory.tokenFromType(TokenType.AT);
4337 tokenMap.put(key, value); 4341 tokenMap.put(key, value);
4338 expect(tokenMap.get(key), same(value)); 4342 expect(tokenMap.get(key), same(value));
4339 } 4343 }
4340 } 4344 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/utilities.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698