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

Unified Diff: tests/compiler/dart2js/backend_dart/sexpr2_test.dart

Issue 669673006: Add SExpression test and share tests between dart2dart and analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/backend_dart/sexpr2_test.dart
diff --git a/tests/compiler/dart2js/backend_dart/sexpr2_test.dart b/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..835dd89e2b2cf9be6422e7513548f876cfb9b868
--- /dev/null
+++ b/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
@@ -0,0 +1,29 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Unittest test of the CPS ir generated by the dart2dart compiler.
+library dart_backend.sexpr2_test;
+
+import 'package:compiler/implementation/dart2jslib.dart';
+import 'package:compiler/implementation/cps_ir/cps_ir_nodes_sexpr.dart';
+import 'package:expect/expect.dart';
+
+import '../../../../pkg/analyzer2dart/test/test_helper.dart';
+import '../../../../pkg/analyzer2dart/test/sexpr_data.dart';
+
+import 'test_helper.dart';
+
+main() {
+ performTests(TEST_DATA, asyncTester, (TestSpec result) {
+ return compilerFor(result.input).then((Compiler compiler) {
+ String expectedOutput = result.output.trim();
+ String output = compiler.irBuilder.getIr(compiler.mainFunction)
+ .accept(new SExpressionStringifier()).trim();
+ Expect.equals(expectedOutput, output,
+ '\nInput:\n${result.input}\n'
+ 'Expected:\n$expectedOutput\n'
+ 'Actual:\n$output\n');
+ });
+ });
+}
« no previous file with comments | « tests/compiler/dart2js/backend_dart/end2end_test.dart ('k') | tests/compiler/dart2js/backend_dart/sexpr_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698