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 'compiler_helper.dart'; | 7 import 'compiler_helper.dart'; |
7 | 8 |
8 const String FOO = r""" | 9 const String FOO = r""" |
9 void foo(var a, var b) { | 10 void foo(var a, var b) { |
10 } | 11 } |
11 """; | 12 """; |
12 | 13 |
13 const String BAR = r""" | 14 const String BAR = r""" |
14 void bar(var eval, var $eval) { | 15 void bar(var eval, var $eval) { |
15 } | 16 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 checkNumberOfMatches(new RegExp("var").allMatches(generated).iterator, 1); | 86 checkNumberOfMatches(new RegExp("var").allMatches(generated).iterator, 1); |
86 | 87 |
87 generated = compile(NO_LOCAL, entry: 'foo'); | 88 generated = compile(NO_LOCAL, entry: 'foo'); |
88 Expect.isFalse(generated.contains('var')); | 89 Expect.isFalse(generated.contains('var')); |
89 | 90 |
90 generated = compile(PARAMETER_INIT, entry: 'foo'); | 91 generated = compile(PARAMETER_INIT, entry: 'foo'); |
91 Expect.isTrue(generated.contains('var result = test === true ? 42 : start')); | 92 Expect.isTrue(generated.contains('var result = test === true ? 42 : start')); |
92 // Check that there is only one var declaration. | 93 // Check that there is only one var declaration. |
93 checkNumberOfMatches(new RegExp("var").allMatches(generated).iterator, 1); | 94 checkNumberOfMatches(new RegExp("var").allMatches(generated).iterator, 1); |
94 } | 95 } |
OLD | NEW |