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

Side by Side Diff: tests/compiler/dart2js/backend_dart/sexpr2_test.dart

Issue 1068243002: Overhaul tree IR visitor and rename IR classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add dummy use for RootVisitor and InitializerVisitor without arguments Created 5 years, 8 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 | Annotate | Revision Log
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 /// Unittest test of the CPS ir generated by the dart2dart compiler. 5 /// Unittest test of the CPS ir generated by the dart2dart compiler.
6 library dart_backend.sexpr2_test; 6 library dart_backend.sexpr2_test;
7 7
8 import 'package:compiler/src/dart2jslib.dart'; 8 import 'package:compiler/src/dart2jslib.dart';
9 import 'package:compiler/src/cps_ir/cps_ir_nodes.dart'; 9 import 'package:compiler/src/cps_ir/cps_ir_nodes.dart';
10 import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart'; 10 import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart';
11 import 'package:compiler/src/elements/elements.dart'; 11 import 'package:compiler/src/elements/elements.dart';
12 import 'package:expect/expect.dart'; 12 import 'package:expect/expect.dart';
13 13
14 import '../../../../pkg/analyzer2dart/test/test_helper.dart'; 14 import '../../../../pkg/analyzer2dart/test/test_helper.dart';
15 import '../../../../pkg/analyzer2dart/test/sexpr_data.dart'; 15 import '../../../../pkg/analyzer2dart/test/sexpr_data.dart';
16 16
17 import 'test_helper.dart'; 17 import 'test_helper.dart';
18 18
19 main(List<String> args) { 19 main(List<String> args) {
20 performTests(TEST_DATA, asyncTester, runTest, args); 20 performTests(TEST_DATA, asyncTester, runTest, args);
21 } 21 }
22 22
23 runTest(TestSpec result) { 23 runTest(TestSpec result) {
24 return compilerFor(result.input).then((Compiler compiler) { 24 return compilerFor(result.input).then((Compiler compiler) {
25 void checkOutput(String elementName, 25 void checkOutput(String elementName,
26 Element element, 26 Element element,
27 String expectedOutput) { 27 String expectedOutput) {
28 ExecutableDefinition ir = compiler.irBuilder.getIr(element); 28 RootNode ir = compiler.irBuilder.getIr(element);
29 if (expectedOutput == null) { 29 if (expectedOutput == null) {
30 Expect.isNull(ir, "\nInput:\n${result.input}\n" 30 Expect.isNull(ir, "\nInput:\n${result.input}\n"
31 "No CPS IR expected for $element"); 31 "No CPS IR expected for $element");
32 } else { 32 } else {
33 Expect.isNotNull(ir, "\nInput:\n${result.input}\n" 33 Expect.isNotNull(ir, "\nInput:\n${result.input}\n"
34 "No CPS IR for $element"); 34 "No CPS IR for $element");
35 expectedOutput = expectedOutput.trim(); 35 expectedOutput = expectedOutput.trim();
36 String output = ir.accept(new SExpressionStringifier()).trim(); 36 String output = ir.accept(new SExpressionStringifier()).trim();
37 Expect.equals(expectedOutput, output, 37 Expect.equals(expectedOutput, output,
38 "\nInput:\n${result.input}\n" 38 "\nInput:\n${result.input}\n"
(...skipping 14 matching lines...) Expand all
53 element = cls.localLookup( 53 element = cls.localLookup(
54 elementName.substring(elementName.indexOf('.') + 1)); 54 elementName.substring(elementName.indexOf('.') + 1));
55 } else { 55 } else {
56 element = compiler.mainApp.localLookup(elementName); 56 element = compiler.mainApp.localLookup(elementName);
57 } 57 }
58 checkOutput(elementName, element, output); 58 checkOutput(elementName, element, output);
59 }); 59 });
60 } 60 }
61 }); 61 });
62 } 62 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/use_unused_api.dart ('k') | tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698