| Index: tests/compiler/dart2js/js_backend_cps_ir_test.dart
|
| diff --git a/tests/compiler/dart2js/js_backend_cps_ir_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_test.dart
|
| index df21e239e9825f043c0d19478d6a0a47c1e64cb8..75cf4d8dd386e5d2b78fc052a1078b30701fe7f9 100644
|
| --- a/tests/compiler/dart2js/js_backend_cps_ir_test.dart
|
| +++ b/tests/compiler/dart2js/js_backend_cps_ir_test.dart
|
| @@ -3,8 +3,8 @@
|
| // BSD-style license that can be found in the LICENSE file.
|
| // VMOptions=-DUSE_CPS_IR=true
|
|
|
| -// Test that the CPS IR code generator is able to compile the provided
|
| -// example programs.
|
| +// Test that the CPS IR code generator compiles programs and produces the
|
| +// the expected output.
|
|
|
| import 'package:async_helper/async_helper.dart';
|
| import 'package:expect/expect.dart';
|
| @@ -14,62 +14,21 @@ import 'memory_compiler.dart';
|
| import 'package:compiler/src/js/js.dart' as js;
|
| import 'package:compiler/src/common.dart' show Element;
|
|
|
| +import 'js_backend_cps_ir_basic.dart' as basic;
|
| +import 'js_backend_cps_ir_literals.dart' as literals;
|
|
|
| const String TEST_MAIN_FILE = 'test.dart';
|
|
|
| +List<TestEntry> tests = <TestEntry>[]
|
| + ..addAll(basic.tests)
|
| + ..addAll(literals.tests);
|
| +
|
| class TestEntry {
|
| final String source;
|
| final String expectation;
|
| const TestEntry(this.source, [this.expectation]);
|
| }
|
|
|
| -/// The list of tests to run.
|
| -const List<TestEntry> tests = const [
|
| - const TestEntry(
|
| - """
|
| -foo(a) {
|
| - return a;
|
| -}
|
| -main() {
|
| - var a = 10;
|
| - var b = 1;
|
| - var t;
|
| - t = a;
|
| - a = b;
|
| - b = t;
|
| - print(a);
|
| - print(b);
|
| - print(b);
|
| - print(foo(a));
|
| -}
|
| - """,
|
| - """
|
| -function() {
|
| - var a, b;
|
| - a = 10;
|
| - b = 1;
|
| - P.print(b);
|
| - P.print(a);
|
| - P.print(a);
|
| - P.print(V.foo(b));
|
| - return null;
|
| -}"""),
|
| - const TestEntry(
|
| - """
|
| -foo() { return 42; }
|
| -main() { return foo(); }
|
| - """,
|
| - """function() {
|
| - return V.foo();
|
| -}"""),
|
| - const TestEntry("main() {}"),
|
| - const TestEntry("main() { return 42; }"),
|
| - const TestEntry("main() { return; }", """
|
| -function() {
|
| - return null;
|
| -}"""),
|
| -];
|
| -
|
| String formatTest(Map test) {
|
| return test[TEST_MAIN_FILE];
|
| }
|
|
|