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 // Tests for constant folding and lowering String.codeUnitAt. | 5 // Tests for constant folding and lowering String.codeUnitAt. |
6 | 6 |
7 library basic_tests; | 7 library codeUnitAt_tests; |
8 | 8 |
9 import 'js_backend_cps_ir.dart'; | 9 import 'js_backend_cps_ir.dart'; |
10 | 10 |
11 const List<TestEntry> tests = const [ | 11 const List<TestEntry> tests = const [ |
12 | 12 |
13 // Constant folding. | 13 // Constant folding. |
14 const TestEntry(r""" | 14 const TestEntry(r""" |
15 main() { | 15 main() { |
16 print('A'.codeUnitAt(0)); | 16 print('A'.codeUnitAt(0)); |
17 }""",r""" | 17 }""",r""" |
(...skipping 28 matching lines...) Expand all Loading... |
46 for (; i < v0; sum = sum + s.charCodeAt(i), i = i + 1) | 46 for (; i < v0; sum = sum + s.charCodeAt(i), i = i + 1) |
47 ; | 47 ; |
48 return sum; | 48 return sum; |
49 }"""), | 49 }"""), |
50 ]; | 50 ]; |
51 | 51 |
52 | 52 |
53 void main() { | 53 void main() { |
54 runTests(tests); | 54 runTests(tests); |
55 } | 55 } |
OLD | NEW |