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

Unified Diff: tests/compiler/dart2js/js_backend_cps_ir_test.dart

Issue 743973002: Add list literals in js cps codegen. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/js_backend_cps_ir_literals.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
}
« no previous file with comments | « tests/compiler/dart2js/js_backend_cps_ir_literals.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698