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

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

Issue 1168393003: Enforce LF line endings in the git database. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rebase Created 5 years, 6 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
index 35c31853b4792f82e779049c59bcdffc5079b25a..71d294b2776bf9583b26f20a747d98529466de9a 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
@@ -1,62 +1,62 @@
-// 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/src/dart2jslib.dart';
-import 'package:compiler/src/cps_ir/cps_ir_nodes.dart';
-import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart';
-import 'package:compiler/src/elements/elements.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(List<String> args) {
- performTests(TEST_DATA, asyncTester, runTest, args);
-}
-
-runTest(TestSpec result) {
- return compilerFor(result.input).then((Compiler compiler) {
- void checkOutput(String elementName,
- Element element,
- String expectedOutput) {
- FunctionDefinition ir = compiler.irBuilder.getIr(element);
- if (expectedOutput == null) {
- Expect.isNull(ir, "\nInput:\n${result.input}\n"
- "No CPS IR expected for $element");
- } else {
- Expect.isNotNull(ir, "\nInput:\n${result.input}\n"
- "No CPS IR for $element");
- expectedOutput = expectedOutput.trim();
- String output = ir.accept(new SExpressionStringifier()).trim();
- Expect.equals(expectedOutput, output,
- "\nInput:\n${result.input}\n"
- "Expected for '$elementName':\n$expectedOutput\n"
- "Actual for '$elementName':\n$output\n");
- }
- }
-
- if (result.output is String) {
- checkOutput('main', compiler.mainFunction, result.output);
- } else {
- assert(result.output is Map<String, String>);
- result.output.forEach((String elementName, String output) {
- Element element;
- if (elementName.contains('.')) {
- ClassElement cls = compiler.mainApp.localLookup(
- elementName.substring(0, elementName.indexOf('.')));
- element = cls.localLookup(
- elementName.substring(elementName.indexOf('.') + 1));
- } else {
- element = compiler.mainApp.localLookup(elementName);
- }
- checkOutput(elementName, element, output);
- });
- }
- });
+// 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/src/dart2jslib.dart';
+import 'package:compiler/src/cps_ir/cps_ir_nodes.dart';
+import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart';
+import 'package:compiler/src/elements/elements.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(List<String> args) {
+ performTests(TEST_DATA, asyncTester, runTest, args);
+}
+
+runTest(TestSpec result) {
+ return compilerFor(result.input).then((Compiler compiler) {
+ void checkOutput(String elementName,
+ Element element,
+ String expectedOutput) {
+ FunctionDefinition ir = compiler.irBuilder.getIr(element);
+ if (expectedOutput == null) {
+ Expect.isNull(ir, "\nInput:\n${result.input}\n"
+ "No CPS IR expected for $element");
+ } else {
+ Expect.isNotNull(ir, "\nInput:\n${result.input}\n"
+ "No CPS IR for $element");
+ expectedOutput = expectedOutput.trim();
+ String output = ir.accept(new SExpressionStringifier()).trim();
+ Expect.equals(expectedOutput, output,
+ "\nInput:\n${result.input}\n"
+ "Expected for '$elementName':\n$expectedOutput\n"
+ "Actual for '$elementName':\n$output\n");
+ }
+ }
+
+ if (result.output is String) {
+ checkOutput('main', compiler.mainFunction, result.output);
+ } else {
+ assert(result.output is Map<String, String>);
+ result.output.forEach((String elementName, String output) {
+ Element element;
+ if (elementName.contains('.')) {
+ ClassElement cls = compiler.mainApp.localLookup(
+ elementName.substring(0, elementName.indexOf('.')));
+ element = cls.localLookup(
+ elementName.substring(elementName.indexOf('.') + 1));
+ } else {
+ element = compiler.mainApp.localLookup(elementName);
+ }
+ checkOutput(elementName, element, output);
+ });
+ }
+ });
}
« no previous file with comments | « tests/compiler/dart2js/backend_dart/end2end_test.dart ('k') | tests/compiler/dart2js/backend_dart/test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698