| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 constant folding on numbers. | 4 // Test constant folding on numbers. |
| 5 | 5 |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 import 'compiler_helper.dart'; | 7 import 'compiler_helper.dart'; |
| 8 | 8 |
| 9 const String NUMBER_FOLDING = """ | 9 const String NUMBER_FOLDING = """ |
| 10 void main() { | 10 void main() { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 regexp = new RegExp('"foo" === d'); | 74 regexp = new RegExp('"foo" === d'); |
| 75 Expect.isTrue(regexp.hasMatch(generated)); | 75 Expect.isTrue(regexp.hasMatch(generated)); |
| 76 | 76 |
| 77 compileAndMatch( | 77 compileAndMatch( |
| 78 LIST_LENGTH_FOLDING, 'foo', new RegExp(r"return 3")); | 78 LIST_LENGTH_FOLDING, 'foo', new RegExp(r"return 3")); |
| 79 | 79 |
| 80 compileAndMatch( | 80 compileAndMatch( |
| 81 LIST_INDEX_FOLDING, 'foo', new RegExp(r"return 1")); | 81 LIST_INDEX_FOLDING, 'foo', new RegExp(r"return 1")); |
| 82 | 82 |
| 83 compileAndDoNotMatch( | 83 compileAndDoNotMatch( |
| 84 LIST_INDEX_FOLDING, 'foo', new RegExp(r"throw")); | 84 LIST_INDEX_FOLDING, 'foo', new RegExp(r"ioore")); |
| 85 | 85 |
| 86 compileAndMatch( | 86 compileAndMatch( |
| 87 STRING_LENGTH_FOLDING, 'foo', new RegExp(r"return 3")); | 87 STRING_LENGTH_FOLDING, 'foo', new RegExp(r"return 3")); |
| 88 | 88 |
| 89 compileAndMatch( | 89 compileAndMatch( |
| 90 RANGE_ERROR_INDEX_FOLDING, 'foo', new RegExp(r"throw")); | 90 RANGE_ERROR_INDEX_FOLDING, 'foo', new RegExp(r"ioore")); |
| 91 } | 91 } |
| OLD | NEW |