| 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 022533479e2e646b3bac66fa3b656c2970d05ecb..774f14278ee138b0b9b224f3a00c765f67572bbf 100644
|
| --- a/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
|
| +++ b/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
|
| @@ -7,6 +7,7 @@ library dart_backend.sexpr2_test;
|
|
|
| import 'package:compiler/src/dart2jslib.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';
|
| @@ -17,13 +18,24 @@ 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');
|
| + void checkOutput(Element element, String expectedOutput) {
|
| + expectedOutput = expectedOutput.trim();
|
| + String output = compiler.irBuilder.getIr(element)
|
| + .accept(new SExpressionStringifier()).trim();
|
| + Expect.equals(expectedOutput, output,
|
| + '\nInput:\n${result.input}\n'
|
| + 'Expected:\n$expectedOutput\n'
|
| + 'Actual:\n$output\n');
|
| + }
|
| +
|
| + if (result.output is String) {
|
| + checkOutput(compiler.mainFunction, result.output);
|
| + } else {
|
| + assert(result.output is Map<String, String>);
|
| + result.output.forEach((String elementName, String output) {
|
| + checkOutput(compiler.mainApp.localLookup(elementName), output);
|
| + });
|
| + }
|
| });
|
| });
|
| }
|
|
|