| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'package:async_helper/async_helper.dart'; | 6 import 'package:async_helper/async_helper.dart'; |
| 7 import 'compiler_helper.dart'; | 7 import 'compiler_helper.dart'; |
| 8 | 8 |
| 9 const String TEST_1 = r""" | 9 const String TEST_1 = r""" |
| 10 import 'dart:_foreign_helper'; | 10 import 'dart:_foreign_helper'; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // exception. | 82 // exception. |
| 83 } | 83 } |
| 84 """; | 84 """; |
| 85 | 85 |
| 86 main() { | 86 main() { |
| 87 Future check(String test) { | 87 Future check(String test) { |
| 88 var checker = checkerForAbsentPresent(test); | 88 var checker = checkerForAbsentPresent(test); |
| 89 Uri uri = new Uri(scheme: 'dart', path: 'test'); | 89 Uri uri = new Uri(scheme: 'dart', path: 'test'); |
| 90 var compiler = compilerFor(test, uri, expectedErrors: 0); | 90 var compiler = compilerFor(test, uri, expectedErrors: 0); |
| 91 return compiler.run(uri).then((_) { | 91 return compiler.run(uri).then((_) { |
| 92 var element = findElement(compiler, 'main'); | 92 MemberElement element = findElement(compiler, 'main'); |
| 93 var backend = compiler.backend; | 93 var backend = compiler.backend; |
| 94 String generated = backend.getGeneratedCode(element); | 94 String generated = backend.getGeneratedCode(element); |
| 95 checker(generated); | 95 checker(generated); |
| 96 }); | 96 }); |
| 97 } | 97 } |
| 98 | 98 |
| 99 asyncTest(() => Future.wait([ | 99 asyncTest(() => Future.wait([ |
| 100 check(TEST_1), | 100 check(TEST_1), |
| 101 check(TEST_2), | 101 check(TEST_2), |
| 102 check(TEST_3), | 102 check(TEST_3), |
| 103 check(TEST_4), | 103 check(TEST_4), |
| 104 check(TEST_5), | 104 check(TEST_5), |
| 105 ])); | 105 ])); |
| 106 } | 106 } |
| OLD | NEW |