| 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 'compiler_helper.dart'; | 6 import 'compiler_helper.dart'; |
| 7 | 7 |
| 8 main() { | 8 main() { |
| 9 var buffer = new StringBuffer(); | 9 var buffer = new StringBuffer(); |
| 10 buffer.add("var foo("); | 10 buffer.add("var foo("); |
| 11 for (int i = 0; i < 2000; i++) { | 11 for (int i = 0; i < 2000; i++) { |
| 12 buffer.add("x$i, "); | 12 buffer.add("x$i, "); |
| 13 } | 13 } |
| 14 buffer.add("x) { int i = "); | 14 buffer.add("x) { int i = "); |
| 15 for (int i = 0; i < 2000; i++) { | 15 for (int i = 0; i < 2000; i++) { |
| 16 buffer.add("x$i+"); | 16 buffer.add("x$i+"); |
| 17 } | 17 } |
| 18 buffer.add("2000; return i; }"); | 18 buffer.add("2000; return i; }"); |
| 19 var generated = compile(buffer.toString(), 'foo', minify: true); | 19 var generated = compile(buffer.toString(), 'foo', minify: true); |
| 20 RegExp re = const RegExp(r"\(a,b,c"); | 20 RegExp re = new RegExp(r"\(a,b,c"); |
| 21 Expect.isTrue(re.hasMatch(generated)); | 21 Expect.isTrue(re.hasMatch(generated)); |
| 22 | 22 |
| 23 re = const RegExp(r"x,y,z,A,B,C"); | 23 re = new RegExp(r"x,y,z,A,B,C"); |
| 24 Expect.isTrue(re.hasMatch(generated)); | 24 Expect.isTrue(re.hasMatch(generated)); |
| 25 | 25 |
| 26 re = const RegExp(r"Y,Z,a0,a1,a2,a3,a4,a5,a6"); | 26 re = new RegExp(r"Y,Z,a0,a1,a2,a3,a4,a5,a6"); |
| 27 Expect.isTrue(re.hasMatch(generated)); | 27 Expect.isTrue(re.hasMatch(generated)); |
| 28 | 28 |
| 29 re = const RegExp(r"g8,g9,h0,h1"); | 29 re = new RegExp(r"g8,g9,h0,h1"); |
| 30 Expect.isTrue(re.hasMatch(generated)); | 30 Expect.isTrue(re.hasMatch(generated)); |
| 31 | 31 |
| 32 re = const RegExp(r"Z8,Z9,aa0,aa1,aa2"); | 32 re = new RegExp(r"Z8,Z9,aa0,aa1,aa2"); |
| 33 Expect.isTrue(re.hasMatch(generated)); | 33 Expect.isTrue(re.hasMatch(generated)); |
| 34 | 34 |
| 35 re = const RegExp(r"aa9,ab0,ab1"); | 35 re = new RegExp(r"aa9,ab0,ab1"); |
| 36 Expect.isTrue(re.hasMatch(generated)); | 36 Expect.isTrue(re.hasMatch(generated)); |
| 37 | 37 |
| 38 re = const RegExp(r"aZ9,ba0,ba1"); | 38 re = new RegExp(r"aZ9,ba0,ba1"); |
| 39 Expect.isTrue(re.hasMatch(generated)); | 39 Expect.isTrue(re.hasMatch(generated)); |
| 40 } | 40 } |
| OLD | NEW |