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

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

Issue 709493002: Fix 'Unused local variable' hints in analyzer and analysis_server. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/test/file_system/memory_file_system_test.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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.ast_test; 8 library engine.ast_test;
9 9
10 import 'package:analyzer/src/generated/java_core.dart'; 10 import 'package:analyzer/src/generated/java_core.dart';
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 } 950 }
951 } 951 }
952 } 952 }
953 } 953 }
954 } 954 }
955 955
956 void test_inGetterContext_forEachLoop() { 956 void test_inGetterContext_forEachLoop() {
957 SimpleIdentifier identifier = AstFactory.identifier3("a"); 957 SimpleIdentifier identifier = AstFactory.identifier3("a");
958 Expression iterator = AstFactory.listLiteral([]); 958 Expression iterator = AstFactory.listLiteral([]);
959 Statement body = AstFactory.block([]); 959 Statement body = AstFactory.block([]);
960 ForEachStatement forEachStatement = 960 AstFactory.forEachStatement2(identifier, iterator, body);
961 AstFactory.forEachStatement2(identifier, iterator, body);
962 expect(identifier.inGetterContext(), isFalse); 961 expect(identifier.inGetterContext(), isFalse);
963 } 962 }
964 963
965 void test_inReferenceContext() { 964 void test_inReferenceContext() {
966 SimpleIdentifier identifier = AstFactory.identifier3("id"); 965 SimpleIdentifier identifier = AstFactory.identifier3("id");
967 AstFactory.namedExpression(AstFactory.label(identifier), AstFactory.identifi er3("_")); 966 AstFactory.namedExpression(AstFactory.label(identifier), AstFactory.identifi er3("_"));
968 expect(identifier.inGetterContext(), isFalse); 967 expect(identifier.inGetterContext(), isFalse);
969 expect(identifier.inSetterContext(), isFalse); 968 expect(identifier.inSetterContext(), isFalse);
970 } 969 }
971 970
(...skipping 11 matching lines...) Expand all
983 } 982 }
984 } 983 }
985 } 984 }
986 } 985 }
987 } 986 }
988 987
989 void test_inSetterContext_forEachLoop() { 988 void test_inSetterContext_forEachLoop() {
990 SimpleIdentifier identifier = AstFactory.identifier3("a"); 989 SimpleIdentifier identifier = AstFactory.identifier3("a");
991 Expression iterator = AstFactory.listLiteral([]); 990 Expression iterator = AstFactory.listLiteral([]);
992 Statement body = AstFactory.block([]); 991 Statement body = AstFactory.block([]);
993 ForEachStatement forEachStatement = 992 AstFactory.forEachStatement2(identifier, iterator, body);
994 AstFactory.forEachStatement2(identifier, iterator, body);
995 expect(identifier.inSetterContext(), isTrue); 993 expect(identifier.inSetterContext(), isTrue);
996 } 994 }
997 995
998 void test_isQualified_inMethodInvocation_noTarget() { 996 void test_isQualified_inMethodInvocation_noTarget() {
999 MethodInvocation invocation = AstFactory.methodInvocation2("test", [AstFacto ry.identifier3("arg0")]); 997 MethodInvocation invocation = AstFactory.methodInvocation2("test", [AstFacto ry.identifier3("arg0")]);
1000 SimpleIdentifier identifier = invocation.methodName; 998 SimpleIdentifier identifier = invocation.methodName;
1001 expect(identifier.isQualified, isFalse); 999 expect(identifier.isQualified, isFalse);
1002 } 1000 }
1003 1001
1004 void test_isQualified_inMethodInvocation_withTarget() { 1002 void test_isQualified_inMethodInvocation_withTarget() {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 SimpleStringLiteral stringLiteral = new SimpleStringLiteral(token, "value"); 1198 SimpleStringLiteral stringLiteral = new SimpleStringLiteral(token, "value");
1201 expect(stringLiteral.literal, same(token)); 1199 expect(stringLiteral.literal, same(token));
1202 expect(stringLiteral.beginToken, same(token)); 1200 expect(stringLiteral.beginToken, same(token));
1203 expect(stringLiteral.endToken, same(token)); 1201 expect(stringLiteral.endToken, same(token));
1204 expect(stringLiteral.value, "value"); 1202 expect(stringLiteral.value, "value");
1205 } 1203 }
1206 } 1204 }
1207 1205
1208 class StringInterpolationTest extends ParserTestCase { 1206 class StringInterpolationTest extends ParserTestCase {
1209 void test_contentsOffsetEnd() { 1207 void test_contentsOffsetEnd() {
1210 var be = AstFactory.interpolationExpression(AstFactory.identifier3('bb')); 1208 AstFactory.interpolationExpression(AstFactory.identifier3('bb'));
1211 // 'a${bb}ccc' 1209 // 'a${bb}ccc'
1212 { 1210 {
1213 var ae = AstFactory.interpolationString("'a", "a"); 1211 var ae = AstFactory.interpolationString("'a", "a");
1214 var cToken = new StringToken(TokenType.STRING, "ccc'", 10); 1212 var cToken = new StringToken(TokenType.STRING, "ccc'", 10);
1215 var cElement = new InterpolationString(cToken, 'ccc'); 1213 var cElement = new InterpolationString(cToken, 'ccc');
1216 StringInterpolation node = AstFactory.string([ae, ae, cElement]); 1214 StringInterpolation node = AstFactory.string([ae, ae, cElement]);
1217 expect(node.contentsOffset, 1); 1215 expect(node.contentsOffset, 1);
1218 expect(node.contentsEnd, 10 + 4 - 1); 1216 expect(node.contentsEnd, 10 + 4 - 1);
1219 } 1217 }
1220 // '''a${bb}ccc''' 1218 // '''a${bb}ccc'''
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after
2628 runReflectiveTests(BreadthFirstVisitorTest); 2626 runReflectiveTests(BreadthFirstVisitorTest);
2629 runReflectiveTests(ClassDeclarationTest); 2627 runReflectiveTests(ClassDeclarationTest);
2630 runReflectiveTests(ClassTypeAliasTest); 2628 runReflectiveTests(ClassTypeAliasTest);
2631 runReflectiveTests(IndexExpressionTest); 2629 runReflectiveTests(IndexExpressionTest);
2632 runReflectiveTests(NodeListTest); 2630 runReflectiveTests(NodeListTest);
2633 runReflectiveTests(SimpleIdentifierTest); 2631 runReflectiveTests(SimpleIdentifierTest);
2634 runReflectiveTests(SimpleStringLiteralTest); 2632 runReflectiveTests(SimpleStringLiteralTest);
2635 runReflectiveTests(StringInterpolationTest); 2633 runReflectiveTests(StringInterpolationTest);
2636 runReflectiveTests(VariableDeclarationTest); 2634 runReflectiveTests(VariableDeclarationTest);
2637 } 2635 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/file_system/memory_file_system_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698