| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 String expectation = test.expectation; | 72 String expectation = test.expectation; |
| 73 if (expectation != null) { | 73 if (expectation != null) { |
| 74 String expected = test.expectation; | 74 String expected = test.expectation; |
| 75 String found = test.elementName == null | 75 String found = test.elementName == null |
| 76 ? getCodeForMain(compiler) | 76 ? getCodeForMain(compiler) |
| 77 : getCodeForMethod(compiler, test.elementName); | 77 : getCodeForMethod(compiler, test.elementName); |
| 78 if (expected != found) { | 78 if (expected != found) { |
| 79 Expect.fail('Expected:\n$expected\nbut found\n$found'); | 79 Expect.fail('Expected:\n$expected\nbut found\n$found'); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 } catch (e, st) { | 82 } catch (e) { |
| 83 print(e); | 83 print(e); |
| 84 print(st); | |
| 85 Expect.fail('The following test failed to compile:\n' | 84 Expect.fail('The following test failed to compile:\n' |
| 86 '${formatTest(files)}'); | 85 '${formatTest(files)}'); |
| 87 } | 86 } |
| 88 }); | 87 }); |
| 89 } | 88 } |
| 90 } | 89 } |
| OLD | NEW |