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

Side by Side Diff: pkg/analyzer/test/src/dart/ast/utilities_test.dart

Issue 2298913003: Pull in test_reflective_loader 0.0.4 and switch analyzer to it. (Closed)
Patch Set: Fixes for review comments. Created 4 years, 3 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
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.src.dart.ast.utilities_test; 5 library analyzer.test.src.dart.ast.utilities_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/token.dart'; 8 import 'package:analyzer/dart/ast/token.dart';
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
11 import 'package:analyzer/src/dart/ast/utilities.dart'; 11 import 'package:analyzer/src/dart/ast/utilities.dart';
12 import 'package:analyzer/src/dart/element/element.dart'; 12 import 'package:analyzer/src/dart/element/element.dart';
13 import 'package:analyzer/src/generated/java_core.dart'; 13 import 'package:analyzer/src/generated/java_core.dart';
14 import 'package:analyzer/src/generated/java_engine.dart' show Predicate; 14 import 'package:analyzer/src/generated/java_engine.dart' show Predicate;
15 import 'package:analyzer/src/generated/java_engine.dart'; 15 import 'package:analyzer/src/generated/java_engine.dart';
16 import 'package:analyzer/src/generated/testing/ast_factory.dart'; 16 import 'package:analyzer/src/generated/testing/ast_factory.dart';
17 import 'package:analyzer/src/generated/testing/element_factory.dart'; 17 import 'package:analyzer/src/generated/testing/element_factory.dart';
18 import 'package:analyzer/src/generated/testing/token_factory.dart'; 18 import 'package:analyzer/src/generated/testing/token_factory.dart';
19 import 'package:test_reflective_loader/test_reflective_loader.dart';
19 import 'package:unittest/unittest.dart'; 20 import 'package:unittest/unittest.dart';
20 21
21 import '../../../generated/parser_test.dart' show ParserTestCase; 22 import '../../../generated/parser_test.dart' show ParserTestCase;
22 import '../../../generated/test_support.dart'; 23 import '../../../generated/test_support.dart';
23 import '../../../reflective_tests.dart';
24 import '../../../utils.dart'; 24 import '../../../utils.dart';
25 25
26 main() { 26 main() {
27 initializeTestEnvironment(); 27 initializeTestEnvironment();
28 runReflectiveTests(ConstantEvaluatorTest); 28 defineReflectiveTests(ConstantEvaluatorTest);
29 runReflectiveTests(NodeLocatorTest); 29 defineReflectiveTests(NodeLocatorTest);
30 runReflectiveTests(NodeLocator2Test); 30 defineReflectiveTests(NodeLocator2Test);
31 runReflectiveTests(ResolutionCopierTest); 31 defineReflectiveTests(ResolutionCopierTest);
32 runReflectiveTests(ToSourceVisitorTest); 32 defineReflectiveTests(ToSourceVisitorTest);
33 } 33 }
34 34
35 @reflectiveTest 35 @reflectiveTest
36 class ConstantEvaluatorTest extends ParserTestCase { 36 class ConstantEvaluatorTest extends ParserTestCase {
37 void fail_constructor() { 37 void fail_constructor() {
38 Object value = _getConstantValue("?"); 38 Object value = _getConstantValue("?");
39 expect(value, null); 39 expect(value, null);
40 } 40 }
41 41
42 void fail_identifier_class() { 42 void fail_identifier_class() {
(...skipping 3296 matching lines...) Expand 10 before | Expand all | Expand 10 after
3339 * @param expectedSource the source string that the visitor is expected to pro duce 3339 * @param expectedSource the source string that the visitor is expected to pro duce
3340 * @param node the AST node being visited to produce the actual source 3340 * @param node the AST node being visited to produce the actual source
3341 * @throws AFE if the visitor does not produce the expected source for the giv en node 3341 * @throws AFE if the visitor does not produce the expected source for the giv en node
3342 */ 3342 */
3343 void _assertSource(String expectedSource, AstNode node) { 3343 void _assertSource(String expectedSource, AstNode node) {
3344 PrintStringWriter writer = new PrintStringWriter(); 3344 PrintStringWriter writer = new PrintStringWriter();
3345 node.accept(new ToSourceVisitor(writer)); 3345 node.accept(new ToSourceVisitor(writer));
3346 expect(writer.toString(), expectedSource); 3346 expect(writer.toString(), expectedSource);
3347 } 3347 }
3348 } 3348 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698