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

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

Issue 900403003: Support default constructors in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | 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 /// End-to-end test of the dart2dart compiler. 5 /// End-to-end test of the dart2dart compiler.
6 library dart_backend.end2end_test; 6 library dart_backend.end2end_test;
7 7
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:compiler/src/dart2jslib.dart'; 9 import 'package:compiler/src/dart2jslib.dart';
10 import 'package:compiler/src/dart_backend/dart_backend.dart'; 10 import 'package:compiler/src/dart_backend/dart_backend.dart';
11 import 'package:expect/expect.dart'; 11 import 'package:expect/expect.dart';
12 12
13 import '../../../../pkg/analyzer2dart/test/test_helper.dart' hide TestSpec; 13 import '../../../../pkg/analyzer2dart/test/test_helper.dart' hide TestSpec;
14 import '../../../../pkg/analyzer2dart/test/end2end_data.dart'; 14 import '../../../../pkg/analyzer2dart/test/end2end_data.dart';
15 15
16 import 'test_helper.dart'; 16 import 'test_helper.dart';
17 import '../output_collector.dart'; 17 import '../output_collector.dart';
18 18
19 main() { 19 main(List<String> args) {
20 performTests(TEST_DATA, asyncTester, (TestSpec result) { 20 performTests(TEST_DATA, asyncTester, runTest, args);
21 OutputCollector outputCollector = new OutputCollector(); 21 }
22 asyncTest(() => compilerFor(result.input, outputProvider: outputCollector) 22
23 .then((Compiler compiler) { 23 runTest(TestSpec result) {
24 String expectedOutput = result.output.trim(); 24 OutputCollector outputCollector = new OutputCollector();
25 compiler.phase = Compiler.PHASE_COMPILING; 25 asyncTest(() => compilerFor(result.input, outputProvider: outputCollector)
26 DartBackend backend = compiler.backend; 26 .then((Compiler compiler) {
27 backend.assembleProgram(); 27 String expectedOutput = result.output.trim();
28 String output = outputCollector.getOutput('', 'dart').trim(); 28 compiler.phase = Compiler.PHASE_COMPILING;
29 Expect.equals(expectedOutput, output, 29 DartBackend backend = compiler.backend;
30 '\nInput:\n${result.input}\n' 30 backend.assembleProgram();
31 'Expected:\n$expectedOutput\n' 31 String output = outputCollector.getOutput('', 'dart').trim();
32 'Actual:\n$output\n'); 32 Expect.equals(expectedOutput, output,
33 })); 33 '\nInput:\n${result.input}\n'
34 }); 34 'Expected:\n$expectedOutput\n'
35 'Actual:\n$output\n');
36 }));
35 } 37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698