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

Side by Side Diff: pkg/analyzer/test/dart/element/builder_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 unified diff | Download patch
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.dart.element.builder_test; 5 library analyzer.test.dart.element.builder_test;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/standard_ast_factory.dart';
8 import 'package:analyzer/dart/ast/token.dart'; 9 import 'package:analyzer/dart/ast/token.dart';
9 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/src/dart/ast/ast.dart'; 11 import 'package:analyzer/src/dart/ast/ast.dart';
11 import 'package:analyzer/src/dart/element/builder.dart'; 12 import 'package:analyzer/src/dart/element/builder.dart';
12 import 'package:analyzer/src/dart/element/element.dart'; 13 import 'package:analyzer/src/dart/element/element.dart';
13 import 'package:analyzer/src/generated/engine.dart'; 14 import 'package:analyzer/src/generated/engine.dart';
14 import 'package:analyzer/src/generated/resolver.dart'; 15 import 'package:analyzer/src/generated/resolver.dart';
15 import 'package:analyzer/src/generated/source.dart'; 16 import 'package:analyzer/src/generated/source.dart';
16 import 'package:analyzer/src/generated/testing/ast_test_factory.dart'; 17 import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
17 import 'package:analyzer/src/generated/testing/element_factory.dart'; 18 import 'package:analyzer/src/generated/testing/element_factory.dart';
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 VariableElement exceptionVariable = variables[0]; 245 VariableElement exceptionVariable = variables[0];
245 expect(exceptionVariable, isNotNull); 246 expect(exceptionVariable, isNotNull);
246 expect(exceptionVariable.name, exceptionParameterName); 247 expect(exceptionVariable.name, exceptionParameterName);
247 expect(exceptionVariable.hasImplicitType, isFalse); 248 expect(exceptionVariable.hasImplicitType, isFalse);
248 } 249 }
249 250
250 void test_visitCompilationUnit_codeRange() { 251 void test_visitCompilationUnit_codeRange() {
251 TopLevelVariableDeclaration topLevelVariableDeclaration = AstTestFactory 252 TopLevelVariableDeclaration topLevelVariableDeclaration = AstTestFactory
252 .topLevelVariableDeclaration(null, AstTestFactory.typeName4('int'), 253 .topLevelVariableDeclaration(null, AstTestFactory.typeName4('int'),
253 [AstTestFactory.variableDeclaration('V')]); 254 [AstTestFactory.variableDeclaration('V')]);
254 CompilationUnit unit = new CompilationUnit( 255 CompilationUnit unit = astFactory.compilationUnit(
255 topLevelVariableDeclaration.beginToken, 256 topLevelVariableDeclaration.beginToken,
256 null, 257 null,
257 [], 258 [],
258 [topLevelVariableDeclaration], 259 [topLevelVariableDeclaration],
259 topLevelVariableDeclaration.endToken); 260 topLevelVariableDeclaration.endToken);
260 ElementHolder holder = new ElementHolder(); 261 ElementHolder holder = new ElementHolder();
261 ElementBuilder builder = _makeBuilder(holder); 262 ElementBuilder builder = _makeBuilder(holder);
262 unit.beginToken.offset = 10; 263 unit.beginToken.offset = 10;
263 unit.endToken.offset = 40; 264 unit.endToken.offset = 40;
264 unit.accept(builder); 265 unit.accept(builder);
(...skipping 2219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2484 AnalysisEngine.instance.logger = logger; 2485 AnalysisEngine.instance.logger = logger;
2485 try { 2486 try {
2486 _compilationUnit = ParserTestCase.parseCompilationUnit(code); 2487 _compilationUnit = ParserTestCase.parseCompilationUnit(code);
2487 compilationUnit.accept(visitor); 2488 compilationUnit.accept(visitor);
2488 } finally { 2489 } finally {
2489 expect(logger.log, hasLength(0)); 2490 expect(logger.log, hasLength(0));
2490 AnalysisEngine.instance.logger = Logger.NULL; 2491 AnalysisEngine.instance.logger = Logger.NULL;
2491 } 2492 }
2492 } 2493 }
2493 } 2494 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698