| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Test that the CPS IR code generator compiles programs and produces the | 5 // Test that the CPS IR code generator compiles programs and produces the |
| 6 // the expected output. | 6 // the expected output. |
| 7 | 7 |
| 8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
| 9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
| 10 import 'package:compiler/src/apiimpl.dart' | 10 import 'package:compiler/src/apiimpl.dart' |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 String expectation = test.expectation; | 71 String expectation = test.expectation; |
| 72 if (expectation != null) { | 72 if (expectation != null) { |
| 73 String expected = test.expectation; | 73 String expected = test.expectation; |
| 74 String found = test.elementName == null | 74 String found = test.elementName == null |
| 75 ? getCodeForMain(compiler) | 75 ? getCodeForMain(compiler) |
| 76 : getCodeForMethod(compiler, test.elementName); | 76 : getCodeForMethod(compiler, test.elementName); |
| 77 if (expected != found) { | 77 if (expected != found) { |
| 78 Expect.fail('Expected:\n$expected\nbut found\n$found'); | 78 Expect.fail('Expected:\n$expected\nbut found\n$found'); |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 }).catchError((e) { | 81 }).catchError((e, s) { |
| 82 print(s); |
| 82 print(e); | 83 print(e); |
| 83 Expect.fail('The following test failed to compile:\n' | 84 Expect.fail('The following test failed to compile:\n' |
| 84 '${formatTest(files)}'); | 85 '${formatTest(files)}'); |
| 85 }); | 86 }); |
| 86 }); | 87 }); |
| 87 } | 88 } |
| 88 } | 89 } |
| OLD | NEW |