| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Test that parameters keep their names in the output. | 4 // Test that parameters keep their names in the output. |
| 5 | 5 |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 import "../../async_helper.dart"; |
| 7 import 'compiler_helper.dart'; | 8 import 'compiler_helper.dart'; |
| 8 | 9 |
| 9 const String TEST_ONE = r""" | 10 const String TEST_ONE = r""" |
| 10 class A { foo() => 499; } | 11 class A { foo() => 499; } |
| 11 class B { bar() => 499; } | 12 class B { bar() => 499; } |
| 12 class C { gee() => 499; } | 13 class C { gee() => 499; } |
| 13 | 14 |
| 14 void main() { | 15 void main() { |
| 15 new C().gee(); | 16 new C().gee(); |
| 16 new B().bar(); | 17 new B().bar(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 28 new B().bar(); | 29 new B().bar(); |
| 29 new A().foo(); | 30 new A().foo(); |
| 30 } | 31 } |
| 31 """; | 32 """; |
| 32 | 33 |
| 33 main() { | 34 main() { |
| 34 // Make sure that class A, B and C are emitted in that order. For simplicity | 35 // Make sure that class A, B and C are emitted in that order. For simplicity |
| 35 // we just verify that their members are in the correct order. | 36 // we just verify that their members are in the correct order. |
| 36 RegExp regexp = new RegExp(r"foo\$0?:(.|\n)*bar\$0:(.|\n)*gee\$0:"); | 37 RegExp regexp = new RegExp(r"foo\$0?:(.|\n)*bar\$0:(.|\n)*gee\$0:"); |
| 37 | 38 |
| 38 String generated = compileAll(TEST_ONE); | 39 asyncTest(() => compileAll(TEST_ONE).then((generated) { |
| 39 Expect.isTrue(regexp.hasMatch(generated)); | 40 Expect.isTrue(regexp.hasMatch(generated)); |
| 41 })); |
| 40 | 42 |
| 41 generated = compileAll(TEST_TWO); | 43 asyncTest(() => compileAll(TEST_TWO).then((generated) { |
| 42 Expect.isTrue(regexp.hasMatch(generated)); | 44 Expect.isTrue(regexp.hasMatch(generated)); |
| 45 })); |
| 43 } | 46 } |
| OLD | NEW |